Fix bad i18n string (#46454)
Fixes #46440 couple things come together here. Bad escaping: The `{` characters are used for format strings and placeholders like ```clojure impl=> (translate "fr" "After {0}" ["Bob"]) "Après Bob" ``` And if you want _literal_ {'s in your translation string, you must escape them like "'{" or "'}" using an apostrophe. But this isn't the end of our worries. in `resources/zh-CN.edn`, we actually have _two_ translations for the original string: ```clojure "User lookup filter. The placeholder '{login'} will be replaced by the user supplied login." "用户找过滤器,占位符 '{login'} 将替换为用户提供的登录名。" ,,, "User lookup filter. The placeholder '{login}' will be replaced by the user supplied login." "用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。" ``` And this later has unescaped curlies. The fix for that is at https://poeditor.com/projects/po_edit?per_page=20&id=200535&id_language=31&filter=&order=&search=User+lookup+filter but will need to wait for the new source translation string in this instance with the corrected escaping. ```clojure ;; simulate what happens at runtime impl=> (translated-format-string "zh_CN" "User lookup filter. The placeholder '{login}' will be replaced by the user supplied login." {}) "用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。" impl=> (MessageFormat. *1 (locale "zh_CN")) Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67). For input string: "login" ;; the problematic zh-CN string impl=> (MessageFormat. "用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。") Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67). For input string: "login" ;; minimal reproduction impl=> (MessageFormat. "“{login}”") Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67). For input string: "login" ```
Please register or sign in to comment