Description Usage Arguments Value Available languages Default fallbacks Examples
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.
1 2 3 |
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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 | i_("hello", lang = "de")
i_(c("hello", "world"), lang = "es")
i_(list(id = "hello", translate = "world"), lang = "pt", keys = "translate")
## Not run:
ui <- fluidPage(
useShi18ny(),
langSelectorInput("lang", position = "fixed"),
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.