initial commit
This commit is contained in:
18
src/app/i18n/index.ts
Normal file
18
src/app/i18n/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import { detectBrowserLanguage } from "./language";
|
||||
import { resources } from "./resources";
|
||||
|
||||
if (!i18n.isInitialized) {
|
||||
void i18n.use(initReactI18next).init({
|
||||
resources,
|
||||
lng: detectBrowserLanguage(),
|
||||
fallbackLng: "en",
|
||||
supportedLngs: ["en", "zh-CN"],
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export { i18n };
|
||||
Reference in New Issue
Block a user