datasketch / shi18ny

19 stars 7 forks source link

Fix uiLangUpdate for workaround of shi18ny/parmesan clash #33

Open lenafm opened 3 years ago

lenafm commented 3 years ago

Without the updateSelectLangInput function in langSelector (which was removed to temporarily solve the shi18ny/parmesan clash which was blocking modals from shinypanels to open) the translations of text directly in the UI of an app doesn't work, because input$shi18ny_ui_classes isn't created on time by useShi18ny.

There is a workaround for this by adding a shinyjs::delay to the observeEvent in the apps, in which the UI texts are translated (as in code below). This should probably work without the delay function.

  observeEvent(lang(),{
    shinyjs::delay(500, uiLangUpdate(input$shi18ny_ui_classes, lang()))
  })