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

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

问题描述

可能重复:
我在哪里可以获得要填充列表框的所有国家/城市的列表?

我有点进退两难,我需要一份所有国家名称的德语列表.我可以使用以下代码获取英语的此信息,但我不知道如何为德语做到这一点.有什么想法吗?

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

推荐答案

Unicode 联盟维护着几乎所有语言的语言环境翻译列表,当然包括德语.数据存储在非常简单的 XML 文件中.

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.

下载 这个 zip 文件(核心 CLDR data) 从 Unicode Consortium 站点提取 de.xml.您想要的一切(以及更多)都在其中.

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.

国家/地区:XPATH= /ldml/localeDisplayNames/territories/territory

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

当您需要其他语言的信息时,只需从 zip 文件中选择匹配的 xml 文件(例如:French = fr.xml).

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天全站免登陆