1

I can get language code, e.g. "1033" for en-US by,

    using (SPSite site = new SPSite("https://portal.loonetoones.com/default.aspx"))
    using (SPWeb web = site.OpenWeb())
    {
        Console.WriteLine(web.Language.ToString());
        // OUT put is     1033
    }

But I want to know it's culture e.g. I want to know if its en-GB or en-US.

4

Use this code instead,

using (SPSite site = new SPSite("https://portal.loonetoones.com/default.aspx"))
using (SPWeb web = site.OpenWeb())
{
    CultureInfo info = new CultureInfo((int)web.Language);
    Console.WriteLine(info.Name); 
}

For more information check this article out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.