import i18next, { i18n as I18nType } from "i18next";
import en from "./locales/en.json";
import ar from "./locales/ar.json";

export const defaultLanguage = "ar";

export const createHelpCenterI18n = (
  lng: string = defaultLanguage
): I18nType => {
  const instance = i18next.createInstance();
  instance.init({
    resources: {
      en: { translation: en },
      ar: { translation: ar },
    },
    lng,
    fallbackLng: defaultLanguage,
    interpolation: { escapeValue: false },
  });
  return instance;
};
