Closed alber70g closed 3 years ago
you can easly do this as :
label: () -> TAPi18n.__("Length (months)")
autoform:
options: () ->
l = ["a","b","c"]
_.map(l, (e) -> {value: e, label: TAPi18n.__ e})
or something along these lines ...
I can confirm that the solution provided by @abate works, with a small change: -> should be =>
I use my own internal Locale component (powered by i18next under the hood) with reactive database translations, if I change the language, the whole UI, including forms, reactively change translations instantly.
name: {
type: String,
label: () => Locale.translate('group-form-name-label'),
autoform: {
placeholder: () => Locale.translate('group-form-name-placeholder')
}
}
If it would be possible to render labels as html, we could just use any library to provide translations using interpolation. That way we could just do
{{_ "TheLabel" }}
and it'd be translated by the module responsible for it.