iso-639-2

Converting language names to ISO 639 language codes

早过忘川 提交于 2019-12-21 17:41:42
问题 I need to convert language names like 'Hungarian', 'English' to ISO 639 codes. ISO 639-6 would be the best but ISO 639-2 is good enough. What's the best way to achieve this? I should convert the English to locale and get the language with getLanguage()? If thats the only way how can I convert a string like 'English' to a java locale? My goal is to store book language info using the ISO 639 codes. 回答1: You can get a list of ISO 639-2 codes by passing a regular expression of language names to

How to convert IETF BCP 47 language identifier to ISO-639-2?

烈酒焚心 提交于 2019-12-07 06:38:49
问题 I am writing a server API for an iOS application. As a part of the initialization process, the app should send the phone interface language to server via an API call. The problem is that Apple uses something called IETF BCP 47 language identifier in its NSLocale preferredLanguages function. The returned values have different lengths (e.g. [aa, ab, ace, ach, ada, ady, ae, af, afa, afh, agq, ...] , and I found very few parsers that can convert this code to a proper language identifier. I would

How to convert IETF BCP 47 language identifier to ISO-639-2?

半世苍凉 提交于 2019-12-05 11:13:29
I am writing a server API for an iOS application. As a part of the initialization process, the app should send the phone interface language to server via an API call. The problem is that Apple uses something called IETF BCP 47 language identifier in its NSLocale preferredLanguages function . The returned values have different lengths (e.g. [aa, ab, ace, ach, ada, ady, ae, af, afa, afh, agq, ...] , and I found very few parsers that can convert this code to a proper language identifier. I would like to use the more common ISO-639-2 three-letters language identifier , which is ubiquitous, has