import i18next from "i18next";
import { initReactI18next } from "react-i18next";
import locale from "../locale/index.mjs";
function tval(text, options) {
    if (options) return "{{t(".concat(JSON.stringify(text), ", ").concat(JSON.stringify(options), ")}}");
    return "{{t(".concat(JSON.stringify(text), ")}}");
}
const i18n = i18next.createInstance();
const resources = {};
Object.keys(locale).forEach((lang)=>{
    resources[lang] = locale[lang].resources;
});
if ('undefined' != typeof localStorage) i18n.use(initReactI18next).init({
    lng: localStorage.getItem('TACHYBASE_LOCALE') || 'en-US',
    defaultNS: 'core',
    resources: {},
    keySeparator: false,
    nsSeparator: false
});
export { i18n, tval };
