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).
这篇关于任何语言的所有国家列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:任何语言的所有国家列表?
基础教程推荐
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- WPF 模态进度窗口 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
