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 got a site with english, united states.

I changed regional settings to ENGLISH, UNITED KINGDOM

If we installed sharepoint in english, do we also have to install the english language pack?

Then when I create a new site(based on a custom web template), it fails

The log has this error: The site /workspaces/TestingWorkspace2 could not be created. The following exception occurred: The language is not supported on the server..

Actually we create sites via CODE like this:

private SPSite CreateNewSiteCollection(string relativeSiteUrl,
                                           string title,
                                           string description,
                                           string webTemplate)
    {
        SPSite newSiteCollection = null;

        // The creation will only work if you set the primary administrator is set to the current user
        //string primarySiteCollectionAdministratorLogin = SPContext.Current.Web.CurrentUser.LoginName;
        //string primarySiteCollectionAdministratorName = SPContext.Current.Web.CurrentUser.Name;
        //string primarySiteCollectionAdministratorEmail = SPContext.Current.Web.CurrentUser.Email;

        string primarySiteCollectionAdministratorLogin = primarySCAdminLogin;
        string primarySiteCollectionAdministratorName = primarySCAdminName;
        string primarySiteCollectionAdministratorEmail = primarySCAdminEmail;

        // Small change you want to set this variable on a different value as the root site collection
        uint localIdentifier = (uint)SPContext.Current.Web.Locale.LCID;

        try
        {
            // Make sure we are at the root site collection
            // using (SPSite rootSite = new SPSite(GetAuthorityUrl(SPContext.Current.Web.Url)))

            SPWebApplication MyWebApplication = SPWebApplication.Lookup(new Uri(SPContext.Current.Site.Url));
            string webAppUrl = MyWebApplication.GetResponseUri(SPUrlZone.Default).AbsoluteUri;

            using (SPSite rootSite = new SPSite(webAppUrl))
            {
                // If no secondary site collection administrator is provided, use null values
                // in stead of an empty string. Otherwise an Exception will be thrown.

                newSiteCollection = rootSite.SelfServiceCreateSite(
                                        relativeSiteUrl,
                                        title,
                                        description,
                                        localIdentifier,
                                        webTemplate,
                                        primarySiteCollectionAdministratorLogin,
                                        primarySiteCollectionAdministratorName,
                                        primarySiteCollectionAdministratorEmail,
                                        null,
                                        null,
                                        null);
share|improve this question
    
I also found this link: technet.microsoft.com/en-us/library/ff463597.aspx And English United Kingdom - 2057 is not listed there. So it means I can not create sites with locale 2057? What should I do? Create it with 1033 and then change regional settings programatically? Thx –  L.V. Sharepoint Architect Mar 13 '12 at 9:49

1 Answer 1

up vote 1 down vote accepted

I'd use

uint localIdentifier = (uint)SPContext.Current.Web.Language;

to create the new web using the same language as used to create the current web, and then set locale after creation

share|improve this answer
    
SPContext.Current.Web.Language is already uint, no need to cast. I am trying that now :) –  L.V. Sharepoint Architect Mar 13 '12 at 10:26

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.