Skip to content

Make interactive HTML tables localized to locale values given to gt() #1389

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

Merged
merged 5 commits into from
Aug 1, 2023

Conversation

rich-iannone
Copy link
Member

This PR makes it such that interactive HTML tables (usually activated via opt_interactive()) have localized labels/controls. As a simple test case, the following code will yield an interactive table with French-language labels/buttons:

gtcars %>% 
  gt(locale = "fr") %>% 
  opt_interactive(
    active = TRUE,
    use_pagination = TRUE,
    use_pagination_info = TRUE,
    use_sorting = TRUE,
    use_search = TRUE,
    use_filters = TRUE,
    use_resizers = FALSE,
    use_highlight = FALSE,
    use_compact_mode = FALSE,
    use_text_wrapping = TRUE,
    use_page_size_select = TRUE,
    page_size_default = 10,
    page_size_values = 50,
    pagination_type = "numbers"
  )
opt_interactive_i18n

Fixes: #1308

@netlify
Copy link

netlify bot commented Aug 1, 2023

Deploy Preview for quarto-gt-examples failed.

Name Link
🔨 Latest commit 5aaa2e6
🔍 Latest deploy log https://app.netlify.com/sites/quarto-gt-examples/deploys/64c85156869a66000733d607

@rich-iannone rich-iannone merged commit c3e3803 into master Aug 1, 2023
@rich-iannone rich-iannone deleted the table-component-i18n branch August 1, 2023 01:09
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

Successfully merging this pull request may close these issues.

use other language with opt_interactive()
1 participant