// Hmm, looking at the documentation of Locale.getAvailableLocales, I'm not sure
// whether it is really feasible. The doc states "returns a list of all installed Locales".
// The "installed" puzzles me - maybe this is really different per installation, and not only
// per JDK version?
Locale[] availableLocales = Locale.getAvailableLocales();
Set existenceCheck = new HashSet();
for (int i = 0; i < availableLocales.length; ++i) {
String availaleName = availableLocales[i].getLanguage();
if (availableLocales[i].getCountry().length() > 0) {
availaleName += "-" + availableLocales[i].getCountry();
}
existenceCheck.add(availaleName);
}
String notInstalled = "";
int expected = 0,
failed = 0;
while (localeIterator.hasNext()) {
String localeName = (String) localeIterator.next();
++expected;
if (!existenceCheck.contains(localeName)) {
if (notInstalled.length() > 0) {
notInstalled += "; ";
}
notInstalled += localeName;