Skip to content

opt_interactive() with locale "de_CH" and "fr_CH" not working #1637

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

Closed
2 tasks done
lgnbhl opened this issue Apr 25, 2024 · 2 comments · Fixed by #1643
Closed
2 tasks done

opt_interactive() with locale "de_CH" and "fr_CH" not working #1637

lgnbhl opened this issue Apr 25, 2024 · 2 comments · Fixed by #1643

Comments

@lgnbhl
Copy link

lgnbhl commented Apr 25, 2024

Prework

Description

When changing to locale "de_CH" or "fr_CH", the number formating change correctly (the separation mark becomes " ' " for "de_CH", see the mpg column in the example) but the language in the buttons of the interactive table created by opt_interactive() remains in English, while it should be in German for "de_CH" or in French for "fr_CH".

Reproducible example

When using gt(locale = "de_CH") with opt_interactive(), the labels remains in English instead of being in German.

library(gt)
library(dplyr)

mtcars |> 
  mutate(mpg = mpg*1000) |> 
  gt(locale = "de_CH") |> # or "fr_CH"
  fmt_number(mpg, decimals = 2) |>
  opt_interactive()

example

Expected result

When using "de_CH", the buttons of the interactive table should be "1–10 von 32 Zeilen" on the left, "Zurück" and "Weiter" on the left.

@lgnbhl
Copy link
Author

lgnbhl commented Apr 25, 2024

I tried the following workaround but the sep_mark argument doesn't work when using gt(local = "de"):

mtcars |> 
  mutate(mpg = mpg*1000) |> 
  gt(locale = "de") |>
  fmt_number(mpg, decimals = 2, sep_mark = "'") |>
  opt_interactive()

Does someone knows a workaround to have the interactive table in german while using the " ' " separator?

@lgnbhl
Copy link
Author

lgnbhl commented Apr 25, 2024

This bug is linked to the functionality mentioned here: #1389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment