in src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java [787:802]
private static boolean isValidCountryCode(String country) {
boolean isValidCountryCode = false;
// allow user-assigned codes (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#User-assigned_code_elements)
if (USER_ASSIGNED_COUNTRY_CODES_PATTERN.matcher(country.toLowerCase()).matches()) {
isValidCountryCode = true;
} else {
String[] countries = Locale.getISOCountries();
for (int i = 0; i < countries.length; i++) {
if (countries[i].equalsIgnoreCase(country)) {
isValidCountryCode = true; // signal ok
break;
}
}
}
return isValidCountryCode;
}