List of All Countries in any Language?(任何语言的所有国家列表?)
问题描述
可能重复:
我在哪里可以获得要填充列表框的所有国家/城市的列表?
我有点进退两难,我需要一份所有国家名称的德语列表.我可以使用以下代码获取英语的此信息,但我不知道如何为德语做到这一点.有什么想法吗?
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).
这篇关于任何语言的所有国家列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:任何语言的所有国家列表?
基础教程推荐
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
