views:

799

answers:

5

Hey all,

I've got a bit of a dilemma where I need a list of all the country names in German. I can get this info for English using the following code but I'm not sure how to do it for German. Any ideas?

 Dim countries As Generic.List(Of String) = New Generic.List(Of String)
     For Each ci As Globalization.CultureInfo In Globalization.CultureInfo.GetCultures(Globalization.CultureTypes.AllCultures And Globalization.CultureTypes.NeutralCultures)
         Dim ri As Globalization.RegionInfo = New Globalization.RegionInfo(ci.LCID)
         countries.Add(ri.EnglishName)
 Next ci

Thanks,

Matt

A: 

There is a list according to ISO 3166 available at Deutsche Nationalbibliothek:

http://www.d-nb.de/standardisierung/pdf/laendercodes_alph.pdf

A list with English names can be obtained from ISO:

http://www.iso.ch/iso/country_codes/iso_3166_code_lists.htm

Update: With a German localization of the .NET Framework you can use the DisplayName property of the RegionInfo class to get the localized German country name.

0xA3
+1  A: 

From the MSDN, the comment says "Gets the full name of the country/region in the language of the localized version of .NET Framework" for the Property DisplayName.

If you have a German .net Framework, it should be in German.

Icey
"If you have a German .net Framework" ... and your current UICulture is German.
Joe
A: 

A quick Googling revealed this page, which contains a list of quite a lot of countries in German. The list is available in 15 languages on the site. You can probably scrape the data from it and make an XML file to load dynamically if you don't want to rely on the framework language.

lc
A: 

Wikipedia has a List of sovereign states. As this wiki page has been translated into almost any language I suppose you can screenscrape the information there.

lothar
+9  A: 

The Unicode consortium maintains lists of locale translations in virtually all languages, including of course German. The data is stored in very straightforward XML files.

Download this zip file (core CLDR data) from the Unicode Consortium site and extract de.xml. All you want (and much more) is in there.

Countries: XPATH= /ldml/localeDisplayNames/territories/territory

The day you need the info in another language, just pick the matching xml file from the zip file (eg.: French = fr.xml).

Serge - appTranslator
This one has done the trick. Not quite as clean as I would have liked, but it gets the job done.
Sonny Boy