use of com.opensymphony.xwork2.util.StrutsLocalizedTextProvider in project onebusaway-application-modules by camsys.
the class ResourceBundleSupport method getLocaleMap.
public static Map<String, String> getLocaleMap(LocaleProvider localeProvider, Class<?> resourceType) {
StrutsLocalizedTextProvider localizedTextProvider = new StrutsLocalizedTextProvider();
ResourceBundle bundle = localizedTextProvider.findResourceBundle(resourceType.getName(), Locale.getDefault());
Map<String, String> m = new LinkedHashMap<String, String>();
for (Enumeration<String> en = bundle.getKeys(); en.hasMoreElements(); ) {
String key = en.nextElement();
String value = bundle.getString(key);
m.put(key, value);
}
return m;
}
use of com.opensymphony.xwork2.util.StrutsLocalizedTextProvider in project onebusaway-application-modules by camsys.
the class TwilioSupport method addMessage.
protected void addMessage(String msg, Object... args) {
ActionContext context = ActionContext.getContext();
Locale locale = context.getLocale();
ValueStack valueStack = context.getValueStack();
String text = new StrutsLocalizedTextProvider().findText(TwilioSupport.this.getClass(), msg, locale, msg, args, valueStack);
_log.debug("message: " + text);
_message.append(" " + text + " ");
_log.debug(getText(msg));
}
Aggregations