The codes and issues are respectively shown as follows:
#1. the codes:
library(shiny)
library(shi18ny)
ui <- fluidPage(
useShi18ny(),
langSelectorInput("lang", position = "fixed"),
h1(ui_("hello")),
uiOutput("results")
)
server <- function(input, output, session) {
i18n <- list(
defaultLang = "en",
availableLangs = c("es","en", "pt")
)
lang <- callModule(langSelector,"lang", i18n = i18n, showSelector = TRUE)
observeEvent(lang(),{
uiLangUpdate(input$shi18ny_ui_classes, lang())
})
output$results <- renderUI({
list(
h1(i_("world",lang())),
br(),
h4(i_("language",lang()), lang())
)
})
}
shinyApp(ui, server)
#2. the issues:
locale directory does not exists, using default translations
Listening on http://127.0.0.1:7753
locale directory does not exists, using default translations
selected2 en config en
TRUE
config_av_langsesenpt
selected3en config en
initLocale: en
input3 is null TRUE
locale directory does not exists, using default translations
locale directory does not exists, using default translations
I would highly appreciate it if you could help me work it out.
Thank you so much in advance!
All the best,
Andy
The codes and issues are respectively shown as follows:
#1. the codes:
library(shiny)
library(shi18ny)
ui <- fluidPage(
useShi18ny(),
langSelectorInput("lang", position = "fixed"),
h1(ui_("hello")),
uiOutput("results")
)
server <- function(input, output, session) {
i18n <- list(
defaultLang = "en",
availableLangs = c("es","en", "pt")
)
lang <- callModule(langSelector,"lang", i18n = i18n, showSelector = TRUE)
observeEvent(lang(),{
uiLangUpdate(input$shi18ny_ui_classes, lang())
})
output$results <- renderUI({
list(
h1(i_("world",lang())),
br(),
h4(i_("language",lang()), lang())
)
})
}
shinyApp(ui, server)
#2. the issues:
locale directory does not exists, using default translations
Listening on http://127.0.0.1:7753
locale directory does not exists, using default translations
selected2 en config en
TRUE
config_av_langsesenpt
selected3en config en
initLocale: en
input3 is null TRUE
locale directory does not exists, using default translations
locale directory does not exists, using default translations
I would highly appreciate it if you could help me work it out.
Thank you so much in advance!
All the best,
Andy