Add @mui/lab/locale
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
When using localization, the theme can be extended with
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
import { frFR } from '@mui/material/locale';
import merge from 'deepmerge';
// localized theme
const theme = merge(responsiveFontSizes(createTheme(themePreset), frFR);
However, components inside @mui/lab aren't localized.
- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
Examples 🌈
With @mui/lab/locale, extending the theme would decouple de app's responsibility to localize these components.
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
import { frFR } from '@mui/material/locale';
import { frFR as frFR_lab } from '@mui/lab/locale'; // suggested
import merge from 'deepmerge';
// fully localized theme
const theme = merge.all([ responsiveFontSizes(createTheme(themePreset), frFR, frFR_lab ]);
Motivation 🔦
Components like TimePicker aren't localized. Once they are, and they are moved to @mui/material, then their localizations will move with them. User code should not maintain these localization strings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The proposed entry point is @mui/lab/locale, with Lab components such as TimePicker needing localization alongside @mui/material/locale. Start by tracing the existing material locale setup and the Lab component localization data; done means Lab locale exports can be merged into a theme without user-maintained strings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, localization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100