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. Tooltip for boolean-type cell is always in English (true/false) #4203

Closed
kodeschooler opened this issue Mar 15, 2022 · 2 comments
Closed
Labels
component: data grid This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. l10n localization

Comments

@kodeschooler
Copy link

kodeschooler commented Mar 15, 2022

I'm using the grid locale translation keys and there doesn't seem to be a key to define the content inside the tooltip that's generated for boolean cell. The grid renders this: <title>true | false</title> within an svg, and the content is in English even when I specify the localeText using the Spanish translations. I don't think there's a key for this, so how do you control what's displayed in the rendered <title> element? :

// define a column with a boolean type and specify the localeText for the DataGrid to use Spanish translations
const columns : GridColumns = [
{field: "enabled", type: "boolean", headerName: "Activado"}
] 

<DataGrid
  rows={rows}
  columns={columns}
  localeText = {esES.components.MuiDataGrid.defaultProps.localeText}
/>

It will display either true or false when you hover over the checkbox or x mark, regardless of what translations you use. Is there a way to control this ? See image:

BooleanCellTooltip
?

@kodeschooler kodeschooler changed the title tooltip for boolean type in cell is always in english (true/false) tooltip for boolean type cell is always in English (true/false) Mar 15, 2022
@kodeschooler kodeschooler changed the title tooltip for boolean type cell is always in English (true/false) DataGrid. Tooltip for boolean-type cell is always in English (true/false) Mar 16, 2022
@cherniavskii cherniavskii added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 16, 2022
@cherniavskii
Copy link
Member

Hey @kodeschooler
We're missing some translations - see #3211
But good news - you can help us to translate!

es-ES translations are located here - https://github.com/mui/mui-x/blob/master/packages/grid/x-data-grid/src/locales/esES.ts
The ones you've noticed are booleanCellTrueLabel and booleanCellFalseLabel, but feel free to add other missing translations

@cherniavskii cherniavskii added component: data grid This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. l10n localization and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 16, 2022
@kodeschooler
Copy link
Author

@cherniavskii ah, I didn't know that's where the value was coming from. I will try to add those and any others I see. thank you,

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! good first issue Great for first contributions. Enable to learn the contribution process. l10n localization
Projects
None yet
Development

No branches or pull requests

3 participants