i18n.js 598 B

1234567891011121314
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.initI18n = void 0;
  4. const uni_i18n_1 = require("@dcloudio/uni-i18n");
  5. const i18n_1 = require("../../../i18n");
  6. function initI18n(manifestJson) {
  7. const i18nOptions = (0, i18n_1.initI18nOptions)(process.env.UNI_PLATFORM, process.env.UNI_INPUT_DIR, true);
  8. if (i18nOptions) {
  9. manifestJson = JSON.parse((0, uni_i18n_1.compileI18nJsonStr)(JSON.stringify(manifestJson), i18nOptions));
  10. manifestJson.fallbackLocale = i18nOptions.locale;
  11. }
  12. return manifestJson;
  13. }
  14. exports.initI18n = initI18n;