This project is read-only.

Set default culture even before setup Orchard

Topics: Customizing Orchard, Localization
Jan 10, 2013 at 12:39 PM
Edited Jan 10, 2013 at 12:40 PM


How can I change Orchard default culture, even before Setup getting done? I put all translated .po files in their directories, but where I should config Orchard to use these translation (NOT from dashboard)? 

I want Orchard be in my culture's language by default at startup, not in English.

thanks in advance

Jan 10, 2013 at 5:40 PM

Currently, I don't think you can. It would require changes in setup.

Jan 11, 2013 at 4:17 AM

Hi again,

I have modified SetupService.cs in Orchard.Setup module:

            // set site name and settings
            var siteService = environment.Resolve<ISiteService>();
            var siteSettings = siteService.GetSiteSettings().As<SiteSettingsPart>();
            siteSettings.Record.SiteSalt = Guid.NewGuid().ToString("N");
            siteSettings.Record.SiteName = context.SiteName;
            siteSettings.Record.SuperUser = context.AdminUsername;
            //siteSettings.Record.SiteCulture = "en-US";
            siteSettings.Record.SiteCulture = "fa-IR";

            // add default culture
            var cultureManager = environment.Resolve<ICultureManager>();

but it seems nothing changed and still all pages are in english.

I have installed this translation: before runing setup. If it's require to modify any other source code, please guid me.


Jan 11, 2013 at 9:36 AM
Edited Jan 11, 2013 at 9:37 AM

Seems that Orchard alway starts it fly from the en-US ground :)
I agree with you this should be adaptable on setup..... if you fill a an issue, I will vote for it.

Jan 11, 2013 at 5:05 PM

Yes, that won't be enough, you also need an implementation of ICultureSelector that would need to kick in during setup.