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.

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

if (FALSE) { observeEvent(lang(),{ uiLangUpdate(classes = input$shi18ny_ui_classes, lang = lang()) }) }