开发者

Android - Translating language codes

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜