if (key == null) {
return null;
}
WGAResourceBundleManager manager = getwgacore().getResourceBundleManager(designDB);
String label = null;
String forceLanguage = (String) designDB.getAttribute(WGACore.DBATTRIB_FORCE_LABEL_LANGUAGE);
if (forceLanguage != null) {
Locale prefLangLocale = WGLanguage.languageNameToLocale(forceLanguage);
try {
label = LanguageBehaviourTools.fetchLabelForLanguage(manager, containerName, fileName, key, prefLangLocale);
}
catch (IOException e) {
getlog().error("Exception retrieving label " + containerName + "/" + fileName + "/" + key + " for language " + prefLangLocale.toString() + " from DB " + manager.getDb().getDbReference(), e);
}
}
else {
LanguageBehaviour langBehaviour = LanguageBehaviourTools.retrieve(designDB);
label = langBehaviour.webtmlFetchLabel(manager, this, containerName, fileName, key);