feat: init i18n

This commit is contained in:
CalciumIon
2024-12-12 23:32:55 +08:00
parent 16599a900b
commit cd21aa1c56
6 changed files with 1270 additions and 1 deletions

22
web/src/i18n/i18n.js Normal file
View File

@@ -0,0 +1,22 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import enTranslation from './locales/en.json';
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: {
en: {
translation: enTranslation
}
},
fallbackLng: 'en',
interpolation: {
escapeValue: false
}
});
export default i18n;

1183
web/src/i18n/locales/en.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@ import { ThemeProvider } from './context/Theme';
import FooterBar from './components/Footer';
import { StyleProvider } from './context/Style/index.js';
import PageLayout from './components/PageLayout.js';
import './i18n/i18n.js';
// initialization