{
LocaleInfo localeInfo = env.getLocaleInfo();
if (localeArg instanceof ArrayValue) {
for (Value value : ((ArrayValue) localeArg).values()) {
QuercusLocale locale = setLocale(localeInfo,
category,
value.toString());
if (locale != null)
return env.createString(locale.toString());
}
}
else {
QuercusLocale locale = setLocale(localeInfo,
category,
localeArg.toString());
if (locale != null)
return env.createString(locale.toString());
}
for (int i = 0; i < fallback.length; i++) {
QuercusLocale locale = setLocale(localeInfo,
category,
fallback[i].toString());
if (locale != null)
return env.createString(locale.toString());
}
return BooleanValue.FALSE;
}