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

[data grid] Numbers separator (comma or dot) based on localeText prop #14017

Open
LuanAlflen opened this issue Jul 29, 2024 · 2 comments
Open
Labels
component: data grid This is the name of the generic UI component, not the React module! i18n internationalization l10n localization new feature New feature or request

Comments

@LuanAlflen
Copy link

LuanAlflen commented Jul 29, 2024

Summary

Currently columns with type number display the separator based on the browser language, below is more or less how we do the localization and the current behavior of datagrid:

issue-datagrid-separator-current-behavior.mp4

Examples

Would be nice to have an option to utilize the locale of the datagrid independent from the browser language.

This is the desired behavior (this is just an example, is not functional because the textfield allows strings, not only numbers):

issue-datagrid-separator-desired-behavior.mp4

Live demo

Motivation

No response

Search keywords: locale, datagrid, separator, numbers, editing

@LuanAlflen LuanAlflen added new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 29, 2024
@alexfauquette
Copy link
Member

For now, locales are only done with an object mapping key to translation.

I would probably require to add a key code: 'fr-FR' that could be passed to the toLocaleString()

valueFormatter: (value?: number) => (isNumber(value) ? value.toLocaleString() : value || ''),

@michelengelen michelengelen changed the title Numbers separator (comma or dot) based on localeText prop [data grid] Numbers separator (comma or dot) based on localeText prop Jul 29, 2024
@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! l10n localization labels Jul 29, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Jul 29, 2024
@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 29, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 16, 2024

It's almost the same issue as #13222.

@oliviertassinari oliviertassinari added the i18n internationalization label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! i18n internationalization l10n localization new feature New feature or request
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

4 participants