import i18n from "i18next" import LanguageDetector from "i18next-browser-languagedetector"; import { initReactI18next } from "react-i18next"; import lang_kr from "@/assets/locales/ko/translation.json"; import lang_en from "@/assets/locales/en/translation.json"; import lang_jp from "@/assets/locales/jp/translation.json"; // https://developer.chrome.com/docs/extensions/reference/api/i18n export const supportedLngs = { ko: "한국어", en: "English", ja: "日本語", }; const languages = Object.keys(supportedLngs); const resources = { en: { translation: lang_en }, ko: { translation: lang_kr }, ja: { translation: lang_jp } }; i18n .use(LanguageDetector) .use(initReactI18next) .init({ resources, lng: "ko", whitelist: languages, fallbackLng: "ko", debug: false, supportedLngs: Object.keys(supportedLngs), interpolation: { escapeValue: false, }, }); export default i18n;