Closed lenafm closed 3 years ago
Fixes #27
Translations can now be done from a csv with an id column and one or multiple language columns (e.g. en, es, etc).
id
en
es
To use a csv translations, the csv file needs to be located in the locale directory (by default "locale") and needs to be called translations.csv.
translations.csv
To use translations from csv, the customTranslationSource parameter needs to be passed to i18nLoad as follows (default for this parameter is yaml).
customTranslationSource
i18nLoad
yaml
i18n <- list( defaultLang = "en", availableLangs = c("de","en","es"), customTranslationSource = "csv" ) lang <- callModule(langSelector,"lang", i18n = i18n, showSelector = TRUE)
Note that at the moment, for this to work, all translation functions in the app also need to be passed the i18n parameter: i_("translation_id", lang = lang(), i18n = i18n)
i18n
i_("translation_id", lang = lang(), i18n = i18n)
Fixes #27
Translations can now be done from a csv with an
id
column and one or multiple language columns (e.g.en
,es
, etc).To use a csv translations, the csv file needs to be located in the locale directory (by default "locale") and needs to be called
translations.csv
.To use translations from csv, the
customTranslationSource
parameter needs to be passed toi18nLoad
as follows (default for this parameter isyaml
).Note that at the moment, for this to work, all translation functions in the app also need to be passed the
i18n
parameter:i_("translation_id", lang = lang(), i18n = i18n)