-
- Downloads
Handle locationlization errors from java.util.Locale (#22226)
* Handle locationlization errors from java.util.Locale
Indonesian has code "id". But
```
;; java 11
(str (java.util.Locale/forLanguageTag "id")) => "in"
;; java 17
(str (java.util.Locale/forLanguageTag "id")) => "id"
```
And this was bad. Because the frontend sends us the language to use:
"id" for indonesian. We write that down. And then when we need to
construct the index.html page with the correct translations, instead of
using "id"-- the value we were given-- we construct a Locale from "id"
and then get the str value of that which is "in". We don't have a in.edn
file, there's no frontend in.json file, and moment.js has no in
localization. And this all happened because we kept this value we all
agreed upon in a java util class and then asked it for that value back.
* Localization names have hyphens, files underscores
* Added docstring
* docstrings
* Assert language id and POE header value in tests
* localized json files don't exist until a build step
Co-authored-by:
Adam James <adam.vermeer2@gmail.com>
Please register or sign in to comment