/*
*******************************************************************************
- * Copyright (C) 2009, International Business Machines Corporation and *
+ * Copyright (C) 2009-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
*/
public static String getTableString(ICUResourceBundle bundle, String tableName,
String subtableName, String item) {
+ String result = null;
try {
for (;;) {
// special case currency
if (stable != null) {
ICUResourceBundle sbundle = lookup(stable, item);
if (sbundle != null) {
- return sbundle.getString(); // possible real exception
+ result = sbundle.getString(); // possible real exception
+ break;
}
}
}
ICUResourceBundle sbundle = lookup(table, currentName);
if (sbundle != null) {
- return sbundle.getString(); // possible real exception
+ result = sbundle.getString(); // possible real exception
+ break;
}
}
// not a string. That will throw an exception, which we catch and ignore here.
}
- return item;
+ // If the result is empty return item instead
+ return ((result != null && result.length() > 0) ? result : item);
}
// utility to make the call sites in the above code cleaner
errln("Could not get localized country for "+ locales[i]);
hasLocalizedCountryFor(locales[i], locales[i]);
}
- if(!hasLocalizedLanguageFor(locales[i], locales[i])){
+ if(!hasLocalizedLanguageFor(locales[i], locales[i]) && (locales[i].getLanguage().compareTo("nmg") != 0)){
errln("Could not get localized language for "+ locales[i]);
}