Allow multi-line strings using `str` in translation macros (#22901)
* allow str form as the first argument to deferred-tru
* add tests and update doc strings
* migrate more setting descriptions
* Handle multiline translation sources
```clojure
enumerate=> x
(deferred-tru
(str
"Whether an introductory modal should be shown after the next database connection is added. "
"Defaults to false if any non-default database has already finished syncing for this instance."))
enumerate=> (form->string-for-translation x)
"Whether an introductory modal should be shown after the next database connection is added. Defaults to false if any non-default database has already finished syncing for this instance."
```
We get the form from `(g/grasp <file> ::translate)` which returns the
`x`. And then simply pick through it for either a string literal or a
call to `(str <literal>+)`
Co-authored-by:
dan sutton <dan@dpsutton.com>
Showing
- bin/i18n/src/i18n/enumerate.clj 9 additions, 4 deletionsbin/i18n/src/i18n/enumerate.clj
- src/metabase/public_settings.clj 38 additions, 23 deletionssrc/metabase/public_settings.clj
- src/metabase/util/i18n.clj 37 additions, 13 deletionssrc/metabase/util/i18n.clj
- test/metabase/util/i18n_test.clj 26 additions, 5 deletionstest/metabase/util/i18n_test.clj
Loading
Please register or sign in to comment