4

I need to generate a list of localized language names from a list of ISO639-1 two-letter language codes. I will wrap them in links to google translate. How hard can this be? It seems like this would be something that google offers by default, but all I can find from google are lists in one language: "English, French, German, etc"

What I need is, "English, Français, Deutch, etc"

Surely someone has already written a javascript / python / php function or similar?

There is a huge list here with localized names: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

user426798
  • 41
  • 1
  • 5
  • I am actually looking for a better resource than that Wikipedia page as well. One way of doing it is visiting the language page on Wikipedia for each language. I haven't resorted to that, yet. – NinjaCat Sep 02 '10 at 21:11

1 Answers1

4

Wikipedia is absolutely a good source for a almost complete language list. In StackOverflow there is an answer with a list based on Wikipedia with all languages in json format. I wrote a simple function in javascript to get the English and native names for all the languages and published it as a gist: lang.js. For your purpose you can simply pass ISO639-1 language code and get the native name for the language:

getLanguageNativeName("cv"); // --> "чӑваш чӗлхи"
Community
  • 1
  • 1
Anatoly Mironov
  • 7,356
  • 1
  • 26
  • 27