Translate strings, vectors or lists in the Server of a Shiny app. There are
currently 15 languages available for translation (see Available languages
below). Note that the i_
function should be used within the Server of the
app and the ui_
function should be used in the UI.
i_(str, lang = NULL, i18n = NULL, markdown = FALSE, keys = c("name", "label")) ui_(string, lang = NULL)
str | A string, vector or list to be translated. |
---|---|
lang | Code for the language that the original language should be translated into. |
i18n | List of language configurations, can only be set for
|
markdown | Transform markdown text to HTML, can only be set for |
keys | If |
Translation of input text in the same format as the input.
There are currently 15 languages available for translation:
code | language |
ar | Arabic |
ca | Catalan |
da | Danish |
de | German |
en | English |
es | Spanish |
fr | French |
he | Hebrew |
hi | Hindi |
it | Italian |
pt | Portuguese |
pt_BR | Portuguese (Brazil) |
ru | Russian |
sv | Swedish |
zh_CN | Chinese |
If no fallback languages are specified, translations automatically fall back onto the following languages.
original language | fallback language |
es | pt |
pt | es |
fr | pt |
de | nl |
nl | de |
i_("hello", lang = "de")#>#> [1] "Hallo"#>#> [1] "hola" "mundo"#>#> $id #> [1] "hello" #> #> $translate #> [1] "mundo" #>