Deprecated: YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container::__construct(): Implicitly marking parameter $parameterBag as nullable is deprecated, the explicit nullable type must be used instead in /home/nubelus/sharedove/adisjugo/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/Container.php on line 60
Determine programmatically global language and installed language packs in SharePoint 2010 - Adis Jugo blog
Select Page

Determine programmatically global language and installed language packs in SharePoint 2010

A little known class in SharePoint Server Object Model is Microsoft.SharePoint.SPRegionalSettings, but it is exactly there, where some useful info about local (site) and global (farm) regional settings can be found.

For example, to determine the original language in which SharePoint farm was installed, you would write something like:

SPLanguage globalLanguage = SPRegionalSettings.GlobalServerLanguage;

There you can find the name and the locale of the global language. Similar to that, to get info about the lanuage packs, you would use:

SPLanguageCollection languagePacks = SPRegionalSettings.GlobalInstalledLanguages;

Note that the “GlobalInstalledLanguages” collection also contains the default language, not only language interface packs.

But there is much more to the SPRegionalSettings, you would be surprised what can be found there – just take a look at

http://msdn.microsoft.com/en-us/library/ms461103

Previous

Next