Re: Get Culture Info from Language Name



On Jan 31, 11:29 am, "lucky" <tushar.n.pa...@xxxxxxxxx> wrote:
hi guys,
right now i'm going through System.Globalization Namespace. and i
found very intersting class there called CultureInfo.

i was trying to get cultureInfo on the basis of name but i didnt find
the way to do it. for example, if i pass the language name
"Danish","German",Russian", i'm suppose to get the cultureInfo object
of the language.

can anyone help me out here?
i would appriciate any help.

thanks,
Lucky

Lucky,

My implementation through asp.net works like so;
if (Request.UserLanguages != null)
{
if (Request.UserLanguages.Length > 0)
{
Lang = Request.UserLanguages[0]; // just use the first entry
for now
ci = CultureInfo.CreateSpecificCulture(Lang);
}
else
ci = CultureInfo.CreateSpecificCulture("en-gb");
}
else
ci = CultureInfo.CreateSpecificCulture("en-gb");

Not sure if this is what your after, but hopefully it'll help.

.



Relevant Pages

  • Re: Supporting Languages - Welsh ?
    ... So if we use cy-GB as our language, it would work, but only using net2.0 on XPsp2? ... and 2.0)'s predefined cultureInfo list: ... BTW, currently for windows XP, if you're using .net framework 2.0, ... Microsoft Online Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Vorgehensweise - Hauptprojekt - Komponenten - Mehrsprachigkeit
    ... Konstruktur Hauptformular ... System.Globalization.CultureInfo(Language); ... Resources.Culture = new CultureInfo(Language); ... Du hast ja jetzt in Deinem Beispiel nichts im Hauptprojekt gemacht. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: displaying country name in current UI culture?
    ... How about the same way the CultureInfo class does it? ... ResourceManager language fallback rules will be applied. ... >> Spanish), I'm not sure how to get that. ...
    (microsoft.public.dotnet.framework)
  • Store flag in cache/session on BeginRequest event
    ... On BeginRequest event I check and set user language settings. ... check for browser's accepted languages and set Cultureinfo. ... browserlanguage is not supported, CultureInfo is set to a predefined ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Get Culture Info from Language Name
    ... right now i'm going through System.Globalization Namespace. ... found very intersting class there called CultureInfo. ... if i pass the language name ...
    (microsoft.public.dotnet.general)