import i18n from "i18next";
import { useTranslation, initReactI18next } from "react-i18next";
import FirstSection_EN from "./en/firstSection.json";
import FirstSection_VI from "./vi/firstSection.json";
import AboutSection_EN from "./en/aboutSection.json";
import AboutSection_VI from "./vi/aboutSection.json";
import RoadMap_EN from "./en/roadmap.json";
import RoadMap_VI from "./vi/roadmap.json";
import QnA_EN from "./en/qna.json";
import QnA_VI from "./vi/qna.json";

export const locales = {
  en: "English",
  vi: "Việt Nam",
};
export const resources = {
  en: {
    firstSection: FirstSection_EN,
    aboutSection: AboutSection_EN,
    roadmap: RoadMap_EN,
    qna: QnA_EN,
  },
  vi: {
    firstSection: FirstSection_VI,
    aboutSection: AboutSection_VI,
    roadmap: RoadMap_VI,
    qna: QnA_VI,
  },
};
i18n.use(initReactI18next).init({
  resources,
  lng: "en",
  fallbackLng: "en",
  interpolation: {
    escapeValue: false, // react already safes from xss
  },
});
