generate a list of localized language names with links to google translate
Asked Answered
Z

1

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

Zwolle answered 31/8, 2010 at 1:43 Comment(1)
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.Pushbike
P
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"); // --> "чӑваш чӗлхи"
Pl answered 10/2, 2013 at 17:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.