问题
I seek a source for the world's main language names, country names, and territory names, localised into a long list of languages.
Example of localised names of languages:
EN EN English
EN ES Inglés
ES EN Spanish
ES ES Español
Example of localised names of a certain country in south-west Europe:
ES ES España
ES FR Espagne
ES EN Spain
Any idea where can I take/build that from?
回答1:
You can find the information you are looking for in the Unicode Common Locale Data Repository (CLDR) here: http://cldr.unicode.org/
Data is supplied in XML so you will need to import this into your database.
The CLDR publishes human-readable charts for language names and territory (country, continent, etc.) names. In each, there is a section for each language or territory, identified by a standardised code. Then the rows of each section give a localised name, and codes for the languages which use that localised name to refer to the language or territory.
The underlying CLDR data is in XML form. The language and territory names you seek are in directory, repos/cldr/trunk/common/main/, with an XML file for each language, containing the names for various languages and territories localised into that language. For instance, the file es.xml has the Spanish-language names for languages ("español", "inglés") and countries ("España").
回答2:
For country names, you can use geonames, for example here is a list of alternate names for the south west European country. Geonames has an api and data dump that you can use in your programs.
For language names, this list could be useful
回答3:
HERE is a database in multiple formats. Best of luck learning all those languages in their local slang.
来源:https://stackoverflow.com/questions/14163685/seeking-source-for-localized-countries-languages-and-region-names