Skip to content

Commit

Permalink
TRUNK-3142: Made isValid to be more permissive
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorytkowski committed Apr 25, 2013
1 parent 3e493ca commit a397104
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/src/main/java/org/openmrs/util/LocaleUtility.java
Expand Up @@ -226,7 +226,8 @@ public boolean supportsPropertyName(String propertyName) {
public static boolean isValid(Locale locale) {
try {
//Check if the language is available and then verify the country separately, because e.g. fr_RW combination is not among available locales.
return LocaleUtils.isAvailableLocale(new Locale(locale.getLanguage())) && locale.getISO3Country() != null;
return (LocaleUtils.isAvailableLocale(new Locale(locale.getLanguage())) || locale.getISO3Language() != null)
&& locale.getISO3Country() != null;
}
catch (MissingResourceException e) {
return false;
Expand Down

0 comments on commit a397104

Please sign in to comment.