在任何语言的所有国家名单? [英] List of All Countries in any Language?

查看:143
本文介绍了在任何语言的所有国家名单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  

可能重复:
  <一href="http://stackoverflow.com/questions/1788950/where-can-i-get-a-list-of-all-countries-cities-to-populate-a-listbox">Where我可以得到所有国家/城市的列表来填充列表框?

我有一个有点左右为难,我需要在德国的所有国家名称的列表。我可以用下面的code得到这个信息的英语,但我不知道该怎么做了德语。任何想法?

 昏暗国家的Generic.List(串)=新Generic.List(串)
     对于每一个词作为Globalization.CultureInfo在Globalization.CultureInfo.GetCultures(Globalization.CultureTypes.AllCultures和Globalization.CultureTypes.NeutralCultures)
         昏暗里作为Globalization.RegionInfo =新Globalization.RegionInfo(ci.LCID)
         countries.Add(ri.EnglishName)
 接下来词
 

解决方案

单向code财团维持现场翻译列出了几乎所有的语言,当然包括德国。的数据存储在非常简单的XML文件中。

下载这个压缩文件(核心的CLDR 数据),并提取de.xml。所有你想要的(以及更多)就在那里。

国家:XPATH = / LDML / localeDisplayNames /地区/地区

这一天你需要用另一种语言的信息,随便挑从压缩文件(如:法国= fr.xml)匹配的xml文件。

Possible Duplicate:
Where can I get a list of all countries/cities to populate a listbox?

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

解决方案

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).

这篇关于在任何语言的所有国家名单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆