I need to convert in Java from strings like fr_FR
, en_GB
, ja_JP
(meaning the French, English, and Japanese language) to their ISO 639-2 representations: fre/fra
, eng
, jpn
.
Do you know if the notation style fr_FR
complies to a certain standard? I haven't found anything in this regard.
Do you know how can I make the conversion from this notation to ISO 639-2 (3-letter) language codes?
Thanks a lot!
Update: I know the method getISO3Language(). And I also know that I could construct, by iterating the available locales, strings like fr_FR
and then make a mapping with the ISO 639-2 3-letter code - thus, whenever I search for a 3-letter code I can find in the map I constructed. The thing is that I would fit me much better a direct solution. Sorry that I didn't explained this from the beginning.
This too long for a comment so...
Do you know if the notation style fr_FR complies to a certain standard? I haven't found anything in this regard.
The first two letters are the language code:
The language argument is a valid ISO Language Code. These codes are the lower-case, two-letter codes as defined by ISO-639.
The last two letters are the country code:
The country argument is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166.
So now you have found something in this regard, that explains to which standards this notation corresponds.