trendmicro-frontend / tonic-ui

Tonic UI is a UI component library for React, built with Emotion and Styled System. It is designed to be easy to use and easy to customize.
https://trendmicro-frontend.github.io/tonic-ui
MIT License
125 stars 29 forks source link

Support localization for Tonic UI components #891

Open cheton opened 4 months ago

cheton commented 4 months ago

Overview

https://mui.com/material-ui/guides/localization/

MUI utilizes the theme to configure the locale text globally:

import { createTheme, ThemeProvider } from '@mui/material/styles';
import { zhCN } from '@mui/material/locale';

const theme = createTheme(
  {
    palette: {
      primary: { main: '#1976d2' },
    },
  },
  zhCN,
);

<ThemeProvider theme={theme}>
  <App />
</ThemeProvider>;

For more details, you can find the source in the GitHub repository.

To support localization in Tonic UI, DefaultPropsProvider must be implemented. Here are the relevant links:

Related issues: #73, #180

cheton commented 2 months ago

Support for DefaultPropsProvider was introduced in PR #922.

cheton commented 1 week ago

Related to #945