import Polyglot from "node-polyglot";
import { phrases as enPhrases } from "./en";
import { phrases as esPhrases } from "./es";
const phraseMap = {
  en: enPhrases,
  es: esPhrases,
};
function getLang(defaultLang) {
  if (document == undefined)
    return defaultLang;
  return document.querySelector("html").lang || defaultLang;
}
window.polyglot =
  window.polyglot || new Polyglot({ locale: getLang("en") });
const polyglot = window.polyglot;
const locale = polyglot.locale();
polyglot.extend(enPhrases);
if (locale !== "en")
  polyglot.extend(phraseMap[locale] || {});
export function _t(phrase, interpolationOptions) {
  return polyglot.t(phrase, interpolationOptions);
}
//# sourceMappingURL=i18n.js.map
