class LocalesService {

    public String getJsonTranslation(String lng, String ns) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            ClassPathResource resource = new ClassPathResource("/locales/" + lng + "/" + ns + ".json");
            FileCopyUtils.copy(resource.getInputStream(), bos);
        } catch (Exception e) {
            LOGGER.error("Unable to load json translation file: {}", e);
        }
        String jsonString = bos.toString();
        jsons.put(lng + "_" + ns, jsonString);
        return jsonString;
    }

}