uiLangUpdate: Update language in UI translations

Description Usage Arguments Examples

View source: R/i18n.R

Description

This function needs to be included in the Server of the Shiny app if if text is translated in the UI of the app using the ui_ function. It makes sure the language used by ui_ to do the translation is updated when the active (selected) language changes.

Usage

1
uiLangUpdate(classes, lang, i18n = NULL)

Arguments

classes

UI classes; pass input$shi18ny_ui_classes to refer to all instances of ui_.

lang

Code for the language that the original language should be translated into.

In the following example, lang() is the reactive value created by the langSelector function.

Examples

1
2
3
4
5
6
7
## Not run: 
observeEvent(lang(),{
  uiLangUpdate(classes = input$shi18ny_ui_classes,
               lang = lang())
  })

## End(Not run)

jpmarindiaz/shi18ny documentation built on March 31, 2021, 5:15 p.m.