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

Allows custom column filter placeholder #1049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andyquinterom
Copy link
Contributor

This PR allows users to set a custom placeholder for column filters. Currently, it is hard coded to 'All' which makes it almost impossible to setup easily in other languages. (At our company we use Spanish).

This would be really helpful.

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you want to change the language globally (to Spanish), so I think a cleaner approach may be using a global option, e.g., options(DT.columnFilterPlaceholder = ...). That means this PR can be simplified---just replace 'All' with getOption('DT.columnFilterPlaceholder', 'All'). Would you be okay with that?

datatable() has already had too many arguments, and I tend not to add more.

@andyquinterom
Copy link
Contributor Author

It seems you want to change the language globally (to Spanish), so I think a cleaner approach may be using a global option, e.g., options(DT.columnFilterPlaceholder = ...). That means this PR can be simplified---just replace 'All' with getOption('DT.columnFilterPlaceholder', 'All'). Would you be okay with that?

datatable() has already had too many arguments, and I tend not to add more.

Sounds good to me. Shouldnt there be an API that's easier to access for users? since there would be two forms of internationalization, the JSON file passed on to the options.language.url and now this. I understand DataTables is a separate project, but a unified API for Shiny users could be cool to see. I could sit down for a while and think of some sort of unified API for DT internationalization.

What do you think?

@yihui
Copy link
Member

yihui commented Feb 13, 2023

Yes, a unified API is definitely a good idea. Please feel free to make suggestions. Thanks!

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

None yet

3 participants