問題描述
可能重復:
我在哪里可以獲得要填充列表框的所有國家/城市的列表?
我有點進退兩難,我需要一份所有國家名稱的德語列表.我可以使用以下代碼獲取英語的此信息,但我不知道如何為德語做到這一點.有什么想法嗎?
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).
這篇關于任何語言的所有國家列表?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!