Multi Language
Multi Language Setting
Different Language translation settings
How to add a new language?
Let's add spanish language in the existing language.
-
Create a new file
src/Common/locales/sp.json
-
update the below code in the
src/Common/i18n.tsx
fileimport translationGr from './locales/sp.json'; const resources = { sp: { translation: translationSp } };
-
To change default language to spanish? update below
code in the
src/Common/i18n.tsx
filei18n .use(detector) .use(reactI18nextModule) // passes i18n down to react-i18next .init({ resources, lng: "sp", fallbackLng: "sp", // use en if detected lng is not available keySeparator: false, // we do not use keys in form messages.welcome interpolation: { escapeValue: false // react already safes from xss }, });