I’ve been tasked with the awesome job of generating a look-up table for our application culture information. The columns I need to generate data for are:
- Dot Net Code
- Version
- Culture Name
- Country Name
- Language Name
- Java Country Code
- Java Language Code
- Iso Country Code
- Iso Language Code
I have found the globalization name space, but I’m sure someone out there has asked the same question, or there is a table already available.
Thanks for any help
Java uses the 2-letter ISO country and language codes. I recommend getting rid of the ‘Java Country Code’ and ‘Java Language Code’ fields in your lookup table, since they would be redundant.
I assume that wherever you get your ISO country and language codes, you’ll find their corresponding names in English. However, the Java Locale API will give also you the localized names for the country and language, if you need them. (I.e., what is America called in Japan?)
For example, you can do this:
Which, running in the US English locale prints:
Note that you can obtain 3-letter ISO codes from the Locale class, but when constructing them, be sure to only use 2-letter codes.