i need to find a solution to get the native spelling of the countryname in every Culture.
For example:
Germany, ISOCODE: DE
On german Windows-Systems there are the following informations:
- Englishname : Germany
- Nativename : Deutschland
- Displayname : Deutschland
Now i need to know how "Germany"(Englishname) or "Deutschland" (Displayname / Nativename) is written in Netherlands for example.
Output must be
"Duitsland"
When in France, output must be
"Allemagne"
- Every "Output" must be done programmatically.
Is it possible to get the different Displaynames from every Country for a single Country given?
Any help would be appreciated.
Edit: I tried, to change the CultureInfo of the Current Thread to mimic that i am not in germany but in france. But that doesn't worked as aspected. Here's the code i used:
try
{
CultureInfo originalThreadCultureInfo = Thread.CurrentThread.CurrentUICulture;
foreach (CultureInfo CI in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
try
{
if (CI.IsNeutralCulture || !string.IsNullOrEmpty(CI.Parent.Name))
{
Thread.CurrentThread.CurrentUICulture = CI;
Thread.CurrentThread.CurrentCulture = CI;
RegionInfo R = new RegionInfo(this.CultureID);
string EnglishName = R.EnglishName;
string NativeName = R.NativeName;
string DisplayName = R.DisplayName;
}
}
catch (Exception ex) { }
}
Thread.CurrentThread.CurrentCulture = originalThreadCultureInfo;
Thread.CurrentThread.CurrentUICulture = originalThreadCultureInfo;
}
catch (Exception ex) { }