Java itself can list letter codes for available languages ββin locales.
Here is an example to list all supported language codes and remove some codes that we donβt want from the list:
public class TestLocale { public static void main(String[] args) { String[] allLangs = Locale.getISOLanguages(); String[] deprecatedLangs = {"ji", "in", "iw"}; ArrayList<String> validLangs = new ArrayList<String>(Arrays.asList(allLangs)); validLangs.removeAll(Arrays.asList(deprecatedLangs)); for (String lng : validLangs) { System.out.println(lng); } } }
Of course, this list (returned by Locale.getISOLanguages ββ()) depends on your java implementation; so I would install a small servlet to return the result of this function call just to check if the language you are interested in is still supported when switching from one java form to another.
Also note the documentation for the following comment on this method:
[NOTE: ISO 639 is not a stable standard - some language codes have changed. The list this function returns both new and old codes for languages, codes have changed.]
Hope this helps,
source share