Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internationalization for pickerInput's actions-box #679

Closed
tamas-ferenci opened this issue Mar 22, 2024 · 2 comments
Closed

Internationalization for pickerInput's actions-box #679

tamas-ferenci opened this issue Mar 22, 2024 · 2 comments

Comments

@tamas-ferenci
Copy link

While colorPickr (for instance) has an i18n option, I simply couldn't find the way to translate the actions-box of pickerInput (despite the fact the every necessary translation seem to be available in the file https://github.com/dreamRs/shinyWidgets/blob/ae8dbf2a9d0225eb663f38060e2aad017fe9f900/inst/assets/bootstrap-select-1.14.0-beta2/js/i18n/defaults-hu_HU.js).

@pvictor
Copy link
Member

pvictor commented Mar 26, 2024

Hello,
You can specify custom text through the pickerOptions function:

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  pickerInput(
    inputId = "month",
    label = "Select a month:",
    choices = month.name,
    multiple = TRUE,
    options = pickerOptions(
      actionsBox = TRUE,
      selectedTextFormat = "count",
      noneSelectedText = "Válasszon!",
      noneResultsText = "Nincs találat {0}",
      countSelectedText = "{0} elem kiválasztva",
      maxOptionsText ="Legfeljebb {n} elem választható",
      selectAllText = "Mind",
      deselectAllText = "Egyik sem",
      multipleSeparator = ", "
    )
  )
)

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

@tamas-ferenci
Copy link
Author

It works perfectly, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants