use of com.opensymphony.xwork2.TextProviderFactory in project onebusaway-application-modules by camsys.
the class ResourceBundleSupport method getLocaleMap.
public static Map<String, String> getLocaleMap(LocaleProvider localeProvider, Class<?> resourceType) {
TextProviderFactory factory = new TextProviderFactory();
TextProvider provider = factory.createInstance(resourceType, localeProvider);
ResourceBundle bundle = provider.getTexts();
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;
}
Aggregations