Andreas Hartmann
Andreas Hartmann

Reputation: 1883

Is there a standardized java enum for ISO language codes?

I'd like to be able to reference languages in a standardized way (ISO). Is there an existing enumeration as part of java or a common dependency such as Apache that I can reuse rather than having to implement my own?

To emphasize, I'm not looking for countries, but for languages!

Upvotes: 13

Views: 7034

Answers (1)

Nikolas
Nikolas

Reputation: 44506

How about the Locale.getISOLanguages() which covers ISO 639. However, it's not an enum but the String array (String[]).

Returns a list of all 2-letter language codes defined in ISO 639. Can be used to create Locales.

Upvotes: 8

Related Questions