Hello Guys,
I am trying to translate as per language select and everthing in my code is getting translated except the selectInput dropdown values.
library(shiny)
# Define UI for app that draws a histogram ----
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
selectInput("selected_language",
paste0(translator$t("Language"), ":"),
choices = c("Deutsch"="de", "English"="en"), selected = "de"),
selectInput("kpi", label = NULL,
selected = "costs",
choices=c( i18n()$t("Costs")= "costs",
i18n()$t("Impressions") = "impressions",
i18n()$t("Interactions")= "interactions",
i18n()$t("Video Views") ="video_total_views"
)
),
# Main panel for displaying outputs ----
mainPanel(
# Output: Histogram ----
)
)
)
server <- function(input,output,session){
i18n <- reactive({
selected <- input$selected_language
if (length(selected) > 0 && selected %in% translator$languages) {
translator$set_translation_language(selected)
}
translator
})
}
Everything except choices list of selectinput is getting translated
I have already added the translation in csv file and there is some UpdateSelectInput logic required which i am not able to apply!!