Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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