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

[FEAT] Adding translations for defaultColumnTypes'. filterOperators #6285

Closed
sohaibgv opened this issue Aug 28, 2024 · 3 comments
Closed

[FEAT] Adding translations for defaultColumnTypes'. filterOperators #6285

sohaibgv opened this issue Aug 28, 2024 · 3 comments
Labels
enhancement New feature or request up for grabs

Comments

@sohaibgv
Copy link

Is your feature request related to a problem? Please describe.

I want to be able to add translations in the dictionary and make refine automatically use these for the default filterOperators' labels without needing to build my own filters from scratch. Since this is not possible, using the defaultOperators makes it that I get labels that don't translate along. I have to define my own currently anyway so that I can override the label with a translation, which defeats the purpose of having a default. Unable to find a way to do this currently. It makes a lot of sense to pull these by default from your translation provider and fallback to the labels that already exist currently.

Describe alternatives you've considered

No response

Additional context

Filters don't translate along:

Screenshot 2024-08-28 at 16 09 54

Describe the thing to improve

Ideally you simply pass a list of the following type in for example de-DE/common.json:

"filters": { "operators": { "is": "ist", "between": "zwischen", "notBetween": "nicht zwischen", "null": "ist null", "notNull": "ist nicht null" } }, ...

Which makes it that all the filter labels are translated.

@sohaibgv sohaibgv added the enhancement New feature or request label Aug 28, 2024
@BatuhanW
Copy link
Member

Hey @sohaibgv thanks for the issue, looks like a good idea. Would you like to work on this one after discussing the details?

@khuddus
Copy link

khuddus commented Sep 4, 2024

Hi @BatuhanW, I'm interested to work on this issue. Can you assign this to me?

@sohaibgv
Copy link
Author

I found that these translations are actually already defined by the UI library you use and not by refine.

We were using MUI and these ones actually exist in
import { enUS, nlNL } from '@mui/x-data-grid/locales';
Some of the translations that were missing specifically came from
import { nlNL, enUS } from '@mui/x-date-pickers/locales';
and
import { enUS, nlNL } from '@mui/material/locale';

These imports are required to make the filters translate on locale changes.
You can look at the keys MUI defines and add these for any missing locales.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request up for grabs
Projects
None yet
Development

No branches or pull requests

3 participants