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

[DataGrid] Add bgBG locale #983

Merged
merged 6 commits into from
Feb 8, 2021

Conversation

DanailH
Copy link
Member

@DanailH DanailH commented Feb 5, 2021

Fixes #777

This PR adds 'bgBG' locale OTB. Currently, if you want to use that locale you would need to provide it to the grid in the following way:

import { DataGrid, bgBG } from '@material-ui/data-grid'

...

<DataGrid localeText={bgBG.components.MuiDataGrid.defaultProps.localeText} />

The reason is that we want to make it work with createMuiTheme and this is the v5 structure https://material-ui.com/guides/localization/#locale-text - #984

In a separate PR I'll add the ability to set the locale using createMuiTheme because currently, we are missing an identifier for the grid, a.k.a MuiDataGrid.

PS: I found that I missed a couple of labels so I added them as well.

@DanailH DanailH added component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request labels Feb 5, 2021
@DanailH DanailH self-assigned this Feb 5, 2021
@oliviertassinari
Copy link
Member

A side question, will the documentation be added (https://material-ui.com/components/data-grid/localization/#locale-text) when we work on #984?

@DanailH
Copy link
Member Author

DanailH commented Feb 8, 2021

A side question, will the documentation be added (https://material-ui.com/components/data-grid/localization/#locale-text) when we work on #984?

Yes, I would like to make a demo with the theme I think it will be nice to showcase how it works.

As part of this ticket, I can extend the docs saying we have 1 or some OTB locales and point to GitHub for those who would like to contribute, what do you think @oliviertassinari?

@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 8, 2021

@DanailH No specific preferences on having a live demo. I see equal pros & cons so why not.

Linking the folder where the locales are sounds like a great tradeoff. It removes the need to keep a table up to date as we do in for the core component (contributors often forget to update it).

Co-authored-by: Danail Hadjiatanasov <hadjiatanasov@gmail.com>
@DanailH DanailH merged commit 3144816 into mui:master Feb 8, 2021
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! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Support ready-to-use locales
3 participants