生成本地化语言名称列表,其中包含谷歌翻译的链接
我需要从 ISO639-1 两字母语言代码列表生成本地化语言名称列表。我会将它们包含在谷歌翻译的链接中。这有多难?看起来这似乎是谷歌默认提供的东西,但我从谷歌能找到的只是一种语言的列表:“英语,法语,德语等”
我需要的是“英语,法语,德语等”
当然有人已经编写了 javascript / python / php 函数或类似函数吗?
这里有一个包含本地化名称的巨大列表: http://en.wikipedia.org/wiki/ ISO_639-1_代码列表
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
维基百科绝对是几乎完整的语言列表的良好来源。在 StackOverflow 中,有一个答案,其中包含基于维基百科的列表所有语言均采用 json 格式。我用 javascript 编写了一个简单的函数来获取所有语言的英语和本地名称,并将其作为要点发布: lang.js。为了您的目的,您可以简单地传递 ISO639-1 语言代码并获取该语言的本机名称:
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: