ResolveUrl works with incorrect culture value

Topics: Core, Localization, Troubleshooting
Aug 22, 2012 at 5:57 AM


I noticed that ResolveUrl incorrectly uses CurrentUICulture passed to it from CoreShapes.  I am trying to define a script in ResourceManifest.cs using the following:

var currentCulture = _orchardServices.WorkContext.CurrentCulture;            
manifest.DefineScript("Globalize.Cultures").SetBasePath(manifest.BasePath + "scripts/cultures/").SetUrl("globalize.culture.js").SetCultures(currentCulture).SetDependencies("Globalize", "jQuery");

My cultures file is always rendered in en-US instead of nl-BE, which I have setup as the default and only culture for my website.  Reason for this is that my browser is configured to use English (US).  CoreShapes seems to instantiate defaultSettings with the CurrentUICulture rather than the culture setup for the website:

var defaultSettings = new RequireSettings {
                DebugMode = debugMode,
                Culture = CultureInfo.CurrentUICulture.Name,

These settings are passed on to ResolveUrl, which then incorrectly renders my file in en-US.  Any ideas much appreciated.  Thanks in advance.



Aug 22, 2012 at 6:04 AM

If you believe this is in error, please file a bug with as much detail as you can give.

Aug 22, 2012 at 6:33 AM

Hi Bertrand,

Thanks for your feedback, I will definitely do so tonight...