I get a response from a webservice that will return several language codes (ISO 639-2) as options. I now want to translate those into a human understandable word. For example:
eng-> English
ger -> 开发者_JS百科German
fre -> French
How would you translate those words. Should I be using the strings.xml? But how will I get the Resource ID of those words?
Thanks a lot
You can convert 639-2 codes to 639-1 code using answer for this question
and after you get a 2 letter code construct Locale
object and use getDisplayLanguage
method
精彩评论