Add i18n
This commit is contained in:
18
src/i18n/index.ts
Normal file
18
src/i18n/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import i18n from "i18next";
|
||||
import LanguageDetector from "i18next-browser-languagedetector";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import { en } from "./lang/en";
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
debug: true,
|
||||
resources: {
|
||||
en: en
|
||||
},
|
||||
fallbackLng: "en",
|
||||
lng: localStorage.getItem("i18nextLng") || "en",
|
||||
})
|
||||
|
||||
export default i18n;
|
||||
6
src/i18n/lang/en.ts
Normal file
6
src/i18n/lang/en.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import option from "@/assets/locale/en/option.json";
|
||||
|
||||
|
||||
export const en = {
|
||||
option
|
||||
}
|
||||
Reference in New Issue
Block a user