SPWeb.SupportedUICultures property

Gets an enumerable collection of objects with information about cultures supported by the website.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Public ReadOnly Property SupportedUICultures As IEnumerable(Of CultureInfo)
Dim instance As SPWeb
Dim value As IEnumerable(Of CultureInfo)

value = instance.SupportedUICultures

Property value

Type: System.Collections.Generic.IEnumerable<CultureInfo>
An enumerable collection of CultureInfo objects representing cultures that are enabled for this website. The CultureInfo objects are not returned in any particular order.

The AddSupportedUICulture method adds cultures to the list of supported cultures. The default culture is returned by the UICulture property.

The following example is a console application that prints the names of cultures supported by the site and also the name of the default culture for the site.

Imports System
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Text
Imports Microsoft.SharePoint

Module ConsoleApp

    Sub Main()
        Using site As New SPSite("http://localhost")
            Using web As SPWeb = site.RootWeb
                If web.IsMultilingual Then

                    Dim sb As New StringBuilder()
                    Dim sep As String = ", "

                    Dim cultures As IEnumerable(Of CultureInfo) = web.SupportedUICultures

                    For Each culture As CultureInfo In cultures

                    Dim str As String = sb.ToString().Trim(sep.ToCharArray())
                    Console.WriteLine("Supported cultures: {0}", str)
                End If
                Console.WriteLine("Default culture: {0}", web.UICulture.Name)
            End Using
        End Using

        Console.Write(vbCrLf & "Press ENTER to continue....")
    End Sub

End Module