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

support for changing the language of the user interface of reactable #24

Closed
Leo-Lee15 opened this issue Dec 27, 2019 · 3 comments
Closed

Comments

@Leo-Lee15
Copy link

Hi,

Thanks for writing such an awesome package!

As a Chinese user, I think it would be useful if the package could support setting the language of user interface of reactable just like the DT package.

Here is a nice example from the DT package.

image

@glin
Copy link
Owner

glin commented Jan 18, 2020

Hi, thanks for the suggestion. Agreed that this would be useful, and it'll probably be one of the next things I work on. I don't know if there will be translations like in DataTables, but there will definitely be a way to customize text and labels in the table for different locales.

@glin
Copy link
Owner

glin commented Feb 16, 2020

There's now basic support for customizing the language strings in the development version: https://glin.github.io/reactable/reference/reactableLang.html

Here's one example: https://glin.github.io/reactable/articles/examples.html#language-options

And another of a partial Chinese translation, based on the DataTables translation:
https://glin.github.io/reactable/articles/internationalization.html

reactable(
  iris[1:30, ],
  searchable = TRUE,
  showPageSizeOptions = TRUE,
  language = reactableLang(
    searchPlaceholder = "搜索",
    searchLabel = "搜索",
    noData = "没有匹配结果",
    pageSizeOptions = "显示 {rows}",
    pageInfo = "{rowStart} 至 {rowEnd} 项结果,共 {rows} 项",
    pagePrevious = "上页",
    pageNext = "下页",
    # The previous/next page button text is descriptive enough, don't need additional labels
    pagePreviousLabel = "",
    pageNextLabel = ""
  )
)

reactable Chinese translation example

@Leo-Lee15
Copy link
Author

Thanks a lot!

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