Default Language in SharePoint 2010


Default Language:

When we create a site collection or site we could be able to see an option for selecting the language.


Site Collection:

Go to Central Administration => Application Management=> Site Collections => Create Site Collections =>Select a language.



Site:

Go to SharePoint site => Site Actions => New Site => Select Language.



This selection of language becomes the default language for the site or site collection.

The default language can be determined by using the SharePoint 2010 object model.


UICulture Property: SPweb.UICulture property is used to get a CultureInfo object that represents to the default language for the Web site.


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


Steps Involved:

  • Open Visual Studio 2010.

  • Go to File => New => Project.

  • Select Console Application template from the installed templates.

  • Enter the Name and click Ok.

  • Add the following assembly. -Microsoft.SharePoint.dll

  • Add the following namespace. -Using Microsoft.SharePoint ; -Using System.Globalization;

  • Program.cs looks like the following.


  • Build the solution.

  • Hit F5.

  • Output:








PowerShell script:

  1. Go to Start => All Programs => Microsoft SharePoint 2010 products => SharePoint 2010 Management Shell.

  2. Run as an administrator.

  3. Run the following script to get the Default language.