setup new site pages using site UI Culture

This forum is for questions about contributing to the project or proposing features that you would like to develop for the project. 

This thread is closed to new posts. You must sign in to post in the forums.
4/17/2011 12:40:36 PM
Gravatar
Total Posts 23
Ahmed Ali Senior Developer

setup new site pages using site UI Culture

Hi Joe,

 

this changes to setup new site pages using site UI Culture if user set site culture on web.config

this is my changes to the mojoSetup.cs to allow setup initial pages with it's UI Culture

i have send the file to your mail 

and this is lines i have change it

     ////// to setup new site pages using site UI Culture if user set it on web.config

            CultureInfo siteCultureInfo = null;
            if (WebConfigSettings.UseCultureOverride)
            {
                string siteCultureKey = "site" + siteSettings.SiteId.ToInvariantString() + "uiculture";
                if (ConfigurationManager.AppSettings[siteCultureKey] != null)
                {
                    try
                    {
                        string cultureName = ConfigurationManager.AppSettings[siteCultureKey];

 

                        // change these neutral cultures which cannot be used to reasonable specific cultures
                        if (cultureName == "zh-CHS") { cultureName = "zh-CN"; }
                        if (cultureName == "zh-CHT") { cultureName = "zh-HK"; }

                        CultureInfo siteCulture = new CultureInfo(cultureName);
                        siteCultureInfo =  siteCulture;
                    }
                    catch { }
                }
           
            }
            ////// to setup new site pages using site UI Culture if user set it on web.config

 

 

            if (contentPage.ResourceFile.Length > 0)
            {
                //// pageSettings.PageName = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Name);

 

                pageSettings.PageName = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Name, siteCultureInfo,false);

                if (contentPage.Title.Length > 0)
                {
                    //// pageSettings.PageTitle = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Title);
                    pageSettings.PageTitle = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Title, siteCultureInfo, false);
                }
            }
            else
            {
                pageSettings.PageName = contentPage.Name;
                pageSettings.PageTitle = contentPage.Title;
            }

4/18/2011 8:10:17 AM
Gravatar
Total Posts 18439

Re: setup new site pages using site UI Culture

Hi Ahmed,

This change is now in the repository with some refactoring to eliminate code duplication.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.