Get all the languages packs installed on web servers in the SharePoint 2010 farm

Steps Involved:

·         Open Visual Studio 2010.

·         Go to File => New => Project.

·         Select Console Application Template from the installed templates.

·         Enter the name and click on Ok.

·         Add the following assembly.

o    Microsoft.SharePoint.dll

·         Add the following Namespace.

o    Using Microsoft.SharePoint;

·         Replace Program.cs with the following code.

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.SharePoint;

 

namespace Languages

{

    class Program

    {

        static void Main(string[] args)

        {

            using (SPSite site = new SPSite("http://serverName:22222/sites/Test/"))

            {

                using (SPWeb web = site.RootWeb)

                {

                    SPLanguageCollection installedLanguages = web.RegionalSettings.InstalledLanguages;

                    foreach (SPLanguage language in installedLanguages)

                    {

                        Console.WriteLine("Name: {0}, LCID:{1}", language.DisplayName, language.LCID);

                    }

                    Console.ReadLine();

                }

            }

        }

    }

}     

         

 

 

·         Build the solution.

·         Hit F5.

            Languages.png