use of org.mifos.framework.util.helpers.LabelTagUtils in project head by mifos.
the class Column method getLabelText.
private String getLabelText(PageContext pageContext, String key, String bundle) {
UserContext userContext = (UserContext) pageContext.getSession().getAttribute(Constants.USER_CONTEXT_KEY);
LabelTagUtils labelTagUtils = LabelTagUtils.getInstance();
String labelText = null;
try {
labelText = labelTagUtils.getLabel(pageContext, bundle, userContext.getPreferredLocale(), key, null);
} catch (Exception e) {
}
if (StringUtils.isBlank(labelText)) {
labelText = ApplicationContextProvider.getBean(MessageLookup.class).lookup(key);
}
if (StringUtils.isBlank(labelText)) {
try {
char[] charArray = bundle.toCharArray();
charArray[0] = Character.toUpperCase(charArray[0]);
String newBundle = new String(charArray);
labelText = labelTagUtils.getLabel(pageContext, newBundle, userContext.getPreferredLocale(), key, null);
} catch (Exception e) {
labelText = key;
}
}
return labelText;
}
Aggregations