"use strict";
const common_vendor = require("../common/vendor.js");
const locale_zh = require("./zh.js");
const locale_en = require("./en.js");
const locale_pt = require("./pt.js");
const getSystemLanguage = () => {
  let language = "zh";
  language = common_vendor.index.getSystemInfoSync().language;
  if (language.indexOf("zh") !== -1) {
    language = "zh";
  } else if (language.indexOf("en") !== -1) {
    language = "en";
  } else if (language.indexOf("pt") !== -1) {
    language = "pt";
  } else {
    language = "zh";
  }
  return language;
};
const getStorageLanguage = () => {
  try {
    return common_vendor.index.getStorageSync("language") || getSystemLanguage();
  } catch (e) {
    return getSystemLanguage();
  }
};
const i18n = common_vendor.createI18n({
  locale: getStorageLanguage(),
  fallbackLocale: "zh",
  messages: {
    zh: locale_zh.zh,
    en: locale_en.en,
    pt: locale_pt.pt
  }
});
exports.i18n = i18n;
//# sourceMappingURL=../../.sourcemap/mp-weixin/locale/index.js.map
