System.Globalization.CultureInfo and N2.Engine.Globalization.ILanguage

Topics: Developer Forum
Oct 25, 2008 at 8:20 AM
Hi Christian

I've noticed that on the CultureInfo that we get from System.Globalization.CultureInfo and the info that we get from N2.Engine.Globalization.ILanguage is different.
My expectations were that when I have globalized the site the pages will be driven by the selected language and culture so I can freely use DateTime.Now.ToShortDateString() for example to format the dates.
In the moment I am getting the following from System.Globalization.CultureInfo

CurrentCulture: {sv-SE}
CurrentUICulture: {en-US}
InstalledUICulture: {en-US}

and this from Engine.Resolve<N2.Engine.Globalization.ILanguageGateway>().GetLanguage(CurrentPage)

FlagUrl: "~/Edit/Globalization/flags/MK.png"
LanguageCode: "mk-MK"
LanguageTitle: "Macedonian"

Is there some kind of workaround to acomplish this...like in the example above, to have the CurentCulture equals {mk-MK} if the LanguageRoot is Macedonian?

Thanks
Coordinator
Nov 1, 2008 at 5:16 PM
I thought it worked like that. I'll check it out. You could go into the master page and reset the thread culture from there.
Nov 2, 2008 at 7:37 PM
Hi Christian

That is exactly what I did afterwards... but it will be great if it works automaticaly when choosing the language for the site...

Thanks anyway...and one more time N2 ROCKS!!!
Coordinator
Nov 3, 2008 at 7:54 PM
Hi again, in the templates this code is executed at each request. Are you building your own globalization?
Nov 4, 2008 at 6:14 AM
Yes I am buliding my own globalization... for some tips and tricks I am refering to your templates project and stealing some code which I assume is OK?