use of com.tyndalehouse.step.rest.framework.JsonResourceBundle in project step by STEPBible.
the class InternationalJsonController method readBundle.
/**
* Read bundle.
*
* @param locale the locale
* @return the string
*/
private String readBundle(final Locale locale, final String... bundleNames) {
List<ResourceBundle> bundles = new ArrayList<ResourceBundle>(bundleNames.length);
for (String b : bundleNames) {
bundles.add(ResourceBundle.getBundle(b, locale));
}
final JsonResourceBundle jsonResourceBundle = new JsonResourceBundle(bundles);
String jsonResponse;
try {
jsonResponse = objectMapper.writeValueAsString(jsonResourceBundle);
} catch (final IOException e) {
throw new StepInternalException("Unable to read messages", e);
}
return "var __s = " + jsonResponse;
}
Aggregations