From: "Rich" <webstuff@urbanperspective.net>
| I have a two-letter country code and I need to display the name of this
| country in the current UI culture.
[quoted text clipped - 4 lines]
| calculated regardless of the language that the system is set to
| display).
CultureInfo.NativeName is in the language of that culture. So if you're
looking for the native name of the current UI culture, use that.
CultureInfo.DisplayName is (as you found) based on the language of the .NET
framework.
CultureInfo.EnglishName is always the English name for the culture.
If you want to display the name of a culture in some other language (e.g.,
Framework is English, current UI is Spanish, and you want the name of
German culture in Spanish), I'm not sure how to get that.
Katy
Rich Urwin - 07 May 2005 10:21 GMT
Hi,
> If you want to display the name of a culture in some
> other language (e.g., Framework is English, current UI
> is Spanish, and you want the name of German culture in
> Spanish), I'm not sure how to get that.
Thanks for replying - that's exactly what I want! Anybody else have any
suggestions?
cheers,
rich
Marc Bernard - 09 May 2005 17:56 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> Thanks for replying - that's exactly what I want! Anybody else have any
> suggestions?
I would suggest asking in microsoft.public.dotnet.internationalization
:)
Nicole Calinoiu - 09 May 2005 19:05 GMT
How about the same way the CultureInfo class does it? e.g.:
public string GetLocalizedName(CultureInfo targetCulture, CultureInfo
languageCulture)
{
ResourceManager manager = new ResourceManager("mscorlib",
typeof(string).Assembly);
return manager.GetString("Globalization.ci_" + targetCulture.Name,
languageCulture);
}
One important detail is that the mscorlib resources file for the specified
language must be installed on the machine. If not, the usual
ResourceManager language fallback rules will be applied. In other words,
it's probably pretty useless even if all available language packs have been
installed (which is extremely unlikely).
> Hi,
>
[quoted text clipped - 10 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***