-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[data grid] Missing translation for key headerFilterOperatorBetween
#13217
Comments
@ankurheble Just like you provide Something like: const quantityOnlyOperators: GridFilterOperator<any, number>[] = [
{
label: "Between",
headerLabel: "Between", // newly added property
...otherProperties,
},
]; I've tried to update it in your demo, here's the forked version: https://codesandbox.io/p/sandbox/async-snow-nqcjz3 Let me know if it solves your issue. Thanks |
headerFilterOperatorBetween
I had the same problem in my personal app IMHO this is a bad practice: const label =
op?.headerLabel ??
apiRef.current.getLocaleText(
`headerFilterOperator${capitalize(op.value)}` as 'headerFilterOperatorContains',
); It crashes even though the To be clear, this code have been here for ages, it's not a new problem at all, it was already here when I was working on the grid. |
Thanks, this somehow didn't work in my local even though headerLabel was provided... but it might be something i'm doing wrong! I see the demo link you provided is working.. I'll try this again.. thanks @MBilalShafi |
@MBilalShafi I tried your solution but it appears to work only for 1 custom filter.. I tried to include the default numeric filters along with the custom one and it still fails with the same translation key error.
Updated my codesandbox to reflect this https://codesandbox.io/p/sandbox/nostalgic-pascal-9twstk?file=%2Fsrc%2FDemo.tsx%3A91%2C1-114%2C3 |
Thank you @ankurheble for providing the updated demo, this indeed is something we could fix internally. For the broader problem, I agree the dx is not great and it should be improved, thank you @flaviendelangle for the suggestion, I remember we did discuss the problem during the implementation of header filters but settled on the same thing which was in normal filters back then. I've created a separate issue to track and solve this problem. |
@ankurheble: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Link to live example: (required)
https://codesandbox.io/p/sandbox/nostalgic-pascal-9twstk?file=%2Fsrc%2FDemo.tsx%3A141%2C22
Steps:
Missing translation for key headerFilterOperatorBetween. is shown
![image](https://private-user-images.githubusercontent.com/32863848/333110023-8bcf5b60-edeb-489e-937b-649ea46bfb36.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNDQyOTYsIm5iZiI6MTcyMDA0Mzk5NiwicGF0aCI6Ii8zMjg2Mzg0OC8zMzMxMTAwMjMtOGJjZjViNjAtZWRlYi00ODllLTkzN2ItNjQ5ZWE0NmJmYjM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDIxNTk1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmMjMzMTMyMWQ3Zjk0ZmU1ODZlNGNkNTFkOTJmMGMzNzM2MTc0YTJiMTg1NTUzNWY3OWMwNjEyZDQ3ODliMGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aP-TspB6nDBEkR798kyTjL-xVz0NDRBhO-l70PM6hY8)
Current behavior
Throws an error : Missing translation for key headerFilterOperatorBetween.
![image](https://private-user-images.githubusercontent.com/32863848/333110086-eed11b7c-c6fe-4fb5-b313-e55e38e02c7c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNDQyOTYsIm5iZiI6MTcyMDA0Mzk5NiwicGF0aCI6Ii8zMjg2Mzg0OC8zMzMxMTAwODYtZWVkMTFiN2MtYzZmZS00ZmI1LWIzMTMtZTU1ZTM4ZTAyYzdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDIxNTk1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkZGVjMGJkNTc1MmQ2ZDhiYzE3NjkyMGE0NzkxODQ0ZDRjMDhlOTRmNzkyOTE2ZmY3NDk3NmI5MjExYjQxYmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.GllDYVHQPVOBF_S5KCvJmJVqkj_AZhp8VZllIVOf57E)
Expected behavior
Should use the same translation added for the custom operator.
Context
Trying to implement a multiple values operator for column type number in DataGridPro with headerFilters enabled.
Your environment
System: OS: Windows 11 10.0.22631 Binaries: Node: 20.11.1 - C:\Program Files\nodejs\node.EXE npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD pnpm: Not Found Browsers: Brave Browser: Chromium (125.0.6422.60) Edge: Chromium (123.0.2420.97) npmPackages: @emotion/react: ^11.11.4 => 11.11.4 @emotion/styled: ^11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.40 @mui/core-downloads-tracker: 5.15.18 @mui/icons-material: ^5.15.13 => 5.15.13 @mui/material: ^5.15.12 => 5.15.18 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/styled-engine-sc: ^6.0.0-alpha.17 => 6.0.0-alpha.17 @mui/system: 5.15.15 @mui/types: 7.2.14 @mui/utils: 5.15.14 @mui/x-data-grid: ^7.5.0 => 7.5.0 @mui/x-data-grid-pro: ^7.5.0 => 7.5.0 @mui/x-license: ^7.2.0 => 7.2.0 @types/react: ^18 => 18.2.62 react: ^18 => 18.2.0 react-dom: ^18 => 18.2.0 styled-components: ^6.1.8 => 6.1.8 typescript: ^5 => 5.3.3npx @mui/envinfo
Search keywords: data grid pro, header filters, translation error
Order ID: 90421
The text was updated successfully, but these errors were encountered: