| | |
| | | * @param request For detecting the user's client locale. |
| | | * @param locale If not given, the client's language (browser) will be used. |
| | | * @param keysOnly If true, only the keys will be returned. Default is false. |
| | | * @param prettyPrinter If true then the json output will be in pretty format. |
| | | * @see JsonUtils.toJson |
| | | */ |
| | | @GetMapping("list") |
| | | fun getList( |
| | | request: HttpServletRequest, |
| | | @RequestParam("prettyPrinter", required = false) prettyPrinter: Boolean?, |
| | | @RequestParam("keysOnly", required = false) keysOnly: Boolean?, |
| | | @RequestParam("locale", required = false) locale: String? |
| | | ): String { |
| | | ): Map<String, String> { |
| | | val localeObject: Locale? |
| | | if (StringUtils.isNotBlank(locale)) { |
| | | localeObject = Locale(locale) |
| | | } else { |
| | | localeObject = RestUtils.getUserLocale(request) |
| | | } |
| | | val translations: Map<String, String> = |
| | | I18nClientMessages.getInstance().getAllMessages(localeObject, keysOnly == true) |
| | | return JsonUtils.toJson(translations, prettyPrinter) |
| | | return I18nClientMessages.getInstance().getAllMessages(localeObject, keysOnly == true) |
| | | } |
| | | } |