# How to add MUI localization
WARNING
To use MUI localization you'll have to make changes in the ThemeComponent.tsx file.
You'll have to make a copy of the ThemeComponent.tsx file to keep it as a backup while updating the template.
# Localization Synced With I18n
- Open the
src/@core/theme/ThemeComponent.tsxfile - Import the locales you need from
'@mui/material/locale'
- Import the
useTranslationhook fromreact-i18next
import { useTranslation } from 'react-i18next'
- Create a
langObjvariable
- Initialize the
useTranslationhook
const { i18n } = useTranslation()
- Add the language as a parameter to the
createThemefunction
theme = createTheme(
theme,
{
components: { ...mergeComponentOverrides(theme, settings) },
typography: { ...mergeTypography(theme) }
},
langObj[i18n.language]
)