import i18n from "i18next"
import LanguageDetector from "i18next-browser-languagedetector"
import { initReactI18next } from "react-i18next"
import { en } from "./en"
import { fr } from "./fr"


export const defaultNS = "common"
export const resources = { en, fr } as const

await i18n
    .use(initReactI18next)
    .use(LanguageDetector)
    .init({
        fallbackLng: "en",
        supportedLngs: ["en", "fr"],
        defaultNS,
        resources,
        interpolation: {
            escapeValue: false
        },
    })

export { i18n }
