Mantis MUI React
v3.2.0
v3.2.0
  • Documentation
  • Pre-requisites
  • Quick Start
  • Folder Structure
  • State Management
  • Internationalization
  • Authentication
    • Switch to Auth0
    • Switch to Firebase
    • Switch to AWS Cognito
  • Axios API Calls
  • Routing
  • Project Configuration
  • Color Presets
  • Theme/Style Configuration
  • How to
    • Login as First Page
    • Remove menu render from Backend
    • Remove Authentication
      • Vite
      • NextJS
  • Figma
  • Integration
    • Seed
    • To Existing Project
    • Comparison
  • Components
    • Avatar
    • BreadCrumb
    • Button
    • Dot
    • Main Card
    • Progress
    • SnackBar
    • Tooltip
    • Transitions
  • Dependencies
    • Vite js
    • Next js
  • Roadmap
  • Support
  • Changelog
  • Mantis Eco System
  • FAQ
Powered by GitBook
On this page

Internationalization

Localization support Edge, Chrome, Firefox & Safari.

Mantis supports four types of international languages ('en' - English, 'fr' - French, 'ro' - Romanian, 'zh' - Chinese). You can switch language from the header bar. We internationalize the main menu for all four languages, When you change it from the header, you will see the effect there. If you want to configure one more language or set a default language then continue reading below...

How does it work?

Data for locale files exist at src\utils\locales

.json file
{
  "accordion": "Accordion",
  "account-profile": "Account Profile",
  "add-new-product": "Add New Product",
  ...
  ...
}

To change Locale, open the file src\config.js file and set language

config.js
const config = {
    ...
    i18n: 'en', // 'en' - English, 'fr' - French, 'ro' - Romanian, 'zh' - Chinese
    ...
}
config.ts
import { PaletteMode } from '@material-ui/core';

const config: {
    ...
    i18n: string;
    ...    
    };
} = {
    ...
    // 'en' - English, 'fr' - French, 'ro' - Romanian, 'zh' - Chinese
    i18n: 'en',
    ...
};

export default config;

For Vite: Open file App.js and apply IntlProvider

App.js

...
...

// ===========================|| APP - THEME, ROUTER, LOCAL ||=========================== //

const App = () => (
...
      <Locales>
      ...      
      </Locales>
...
);

export default App;
App.tsx
...
...

// ===========================|| APP ||=========================== //

const App = () => (
...
      <Locales>
      ...      
      </Locales>
...
);

export default App;

For NextJS: Open file .../src/app/ProviderWrapper.tsx and apply IntlProvider

ProviderWrapper.js
'use client';
import PropTypes from 'prop-types';
...
...

// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //

export default function ProviderWrapper({ children }: { children: ReactElement }) {
      return (
            ...
            <Locales>
            ...      
            </Locales>
            ...
         );
}

ProviderWrapper.propTypes = { children: PropTypes.node };
ProviderWrapper.js
'use client';
...
...

// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //

export default function ProviderWrapper({ children }: { children: ReactElement }) {
      return (
            ...
            <Locales>
            ...      
            </Locales>
            ...
         );
}
PreviousState ManagementNextAuthentication

Last updated 9 months ago