use of org.hisp.dhis.webapi.webdomain.i18n.I18nInput in project dhis2-core by dhis2.
the class I18nController method postI18n.
@PostMapping
@ResponseBody
public I18nOutput postI18n(@RequestParam(value = "package", required = false, defaultValue = "org.hisp.dhis") String searchPackage, HttpServletResponse response, InputStream inputStream) throws Exception {
I18n i18n = i18nManager.getI18n(searchPackage);
I18nOutput output = new I18nOutput();
I18nInput input = jsonMapper.readValue(inputStream, I18nInput.class);
for (String key : input) {
String value = i18n.getString(key);
if (value != null) {
output.getTranslations().put(key, value);
}
}
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
return output;
}
Aggregations