update
This commit is contained in:
13
frontend/src/_locales/i18n-react.ts
Normal file
13
frontend/src/_locales/i18n-react.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import i18n, {changeLanguage} from 'i18next';
|
||||
import {initReactI18next} from 'react-i18next';
|
||||
import {resources} from './resources';
|
||||
import {getNavigatorLanguage} from '../utils';
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
resources,
|
||||
interpolation: {
|
||||
escapeValue: false // not needed for react as it escapes by default
|
||||
}
|
||||
}).then(() => {
|
||||
changeLanguage(getNavigatorLanguage());
|
||||
});
|
||||
9
frontend/src/_locales/i18n.ts
Normal file
9
frontend/src/_locales/i18n.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import i18n, {changeLanguage} from 'i18next';
|
||||
import {resources} from './resources';
|
||||
import {getNavigatorLanguage} from '../utils';
|
||||
|
||||
i18n.init({
|
||||
resources
|
||||
}).then(() => {
|
||||
changeLanguage(getNavigatorLanguage());
|
||||
});
|
||||
37
frontend/src/_locales/resources.ts
Normal file
37
frontend/src/_locales/resources.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import zhHans from './zh-hans/main.json'
|
||||
|
||||
export const resources = {
|
||||
zh: {
|
||||
translation: zhHans
|
||||
}
|
||||
// de: {
|
||||
// translation: de,
|
||||
// },
|
||||
// es: {
|
||||
// translation: es,
|
||||
// },
|
||||
// fr: {
|
||||
// translation: fr,
|
||||
// },
|
||||
// in: {
|
||||
// translation: inTrans,
|
||||
// },
|
||||
// it: {
|
||||
// translation: it,
|
||||
// },
|
||||
// ja: {
|
||||
// translation: ja,
|
||||
// },
|
||||
// ko: {
|
||||
// translation: ko,
|
||||
// },
|
||||
// pt: {
|
||||
// translation: pt,
|
||||
// },
|
||||
// ru: {
|
||||
// translation: ru,
|
||||
// },
|
||||
// zhHant: {
|
||||
// translation: zhHant,
|
||||
// },
|
||||
}
|
||||
3
frontend/src/_locales/zh-hans/main.json
Normal file
3
frontend/src/_locales/zh-hans/main.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Settings": "设置"
|
||||
}
|
||||
Reference in New Issue
Block a user