import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import authEn from "./locales/en/auth.json";
import availabilitiesEn from "./locales/en/availabilities.json";
import commonEn from "./locales/en/common.json";
import componentsEn from "./locales/en/components.json";
import modalsEn from "./locales/en/modals.json";
import navigationEn from "./locales/en/navigation.json";
import notesEn from "./locales/en/notes.json";
import pagesEn from "./locales/en/pages.json";
import planningEn from "./locales/en/planning.json";
import settingsEn from "./locales/en/settings.json";
import tabloEn from "./locales/en/tablo.json";
import authFr from "./locales/fr/auth.json";
import availabilitiesFr from "./locales/fr/availabilities.json";
import commonFr from "./locales/fr/common.json";
import componentsFr from "./locales/fr/components.json";
import modalsFr from "./locales/fr/modals.json";
import navigationFr from "./locales/fr/navigation.json";
import notesFr from "./locales/fr/notes.json";
import pagesFr from "./locales/fr/pages.json";
import planningFr from "./locales/fr/planning.json";
import settingsFr from "./locales/fr/settings.json";
import tabloFr from "./locales/fr/tablo.json";

i18n.use(initReactI18next).init({
  resources: {
    fr: {
      common: commonFr,
      navigation: navigationFr,
      pages: pagesFr,
      settings: settingsFr,
      availabilities: availabilitiesFr,
      auth: authFr,
      planning: planningFr,
      modals: modalsFr,
      components: componentsFr,
      notes: notesFr,
      tablo: tabloFr,
    },
    en: {
      common: commonEn,
      navigation: navigationEn,
      pages: pagesEn,
      settings: settingsEn,
      availabilities: availabilitiesEn,
      auth: authEn,
      planning: planningEn,
      modals: modalsEn,
      components: componentsEn,
      notes: notesEn,
      tablo: tabloEn,
    },
  },
  lng: "en",
  fallbackLng: "en",
  defaultNS: "common",
  interpolation: {
    escapeValue: false,
  },
});

export default i18n;
