import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en_Translation from "../src/translations/en_us/common.json";
import es_Translation from "../src/translations/es/common.json";
import fr_Translation from "../src/translations/fr/common.json";

const resources = {
  "en-US": en_Translation,
  "fr-CA": fr_Translation,
  "es-MX": es_Translation
};

i18n.use(initReactI18next).init({
  resources,
  lng: "en-US", // Default to en-US for tests (no LanguageDetector)
  fallbackLng: "en-US",
  debug: false, // Disable debug in tests
  react: {
    useSuspense: false // Disable Suspense for Vitest
  },
  interpolation: {
    escapeValue: false, // React handles XSS
    skipOnVariables: false
  }
});

export default i18n;
