SPRegionalSettings.GlobalInstalledLanguages Property

Gets the collection of language packs that are installed on the server.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online


Public Shared ReadOnly Property GlobalInstalledLanguages As SPLanguageCollection
Dim value As SPLanguageCollection

value = SPRegionalSettings.GlobalInstalledLanguages
public static SPLanguageCollection GlobalInstalledLanguages { get; }

Property Value

Type: Microsoft.SharePoint.SPLanguageCollection
An SPLanguageCollection object that represents the installed language packs.


The following example is a console application that enumerates the installed languages and adds any that are currently not supported to the list of cultures supported by the multilingual user interface.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.SharePoint;

namespace ConsoleApp
    class Program
        static void Main(string[] args)
            using (SPSite site = new SPSite("http://localhost"))
                using (SPWeb web = site.RootWeb)
                    web.IsMultilingual = true;

                    SPLanguageCollection installed = SPRegionalSettings.GlobalInstalledLanguages;
                    IEnumerable<CultureInfo> supported = web.SupportedUICultures;

                    foreach (SPLanguage language in installed)
                        CultureInfo culture = new CultureInfo(language.LCID);

                        if (!supported.Contains(culture))
                            Console.WriteLine("Adding {0}", culture.Name);
            Console.Write("\nPress ENTER to continue....");
Imports System
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Linq
Imports Microsoft.SharePoint

Module ConsoleApp

    Sub Main()
        Using site As New SPSite("http://localhost")
            Using web As SPWeb = site.OpenWeb()

                web.IsMultilingual = True

                Dim installed As SPLanguageCollection = SPRegionalSettings.GlobalInstalledLanguages
                Dim supported As IEnumerable(Of CultureInfo) = web.SupportedUICultures

                For Each language As SPLanguage In installed
                    Dim culture As New CultureInfo(language.LCID)

                    If Not supported.Contains(culture) Then
                        Console.WriteLine("Adding {0}", culture.Name)
                    End If

            End Using
        End Using
        Console.Write(vbCrLf + "Press ENTER to continue....")
    End Sub
End Module

See Also


SPRegionalSettings Class

SPRegionalSettings Members

Microsoft.SharePoint Namespace