require instead of import in i18n

This commit is contained in:
Matteo Manzinello
2020-07-28 13:56:38 +02:00
parent 8caa841de1
commit d35c3594fe
12 changed files with 24 additions and 24 deletions

View File

@@ -235,13 +235,10 @@ function toComment(sourceMap) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ../i18n/i18n.json
var i18n = __webpack_require__(0);
var i18n_namespaceObject = /*#__PURE__*/__webpack_require__.t(i18n, 2);
// CONCATENATED MODULE: ../src/mailgo.ts
// i18n for mailgo
// mailgo scss
var i18n = __webpack_require__(0); // mailgo scss
var mailgoCSS = __webpack_require__(1).toString(); // default lang
@@ -288,14 +285,14 @@ var gmail, outlook, mailgo_open, telegram, wa, skype, call, copyMail, copyTel;
* the function that creates the mailgo elements in DOM
*/
var mailgo_mailgoInit = function mailgoInit() {
var mailgoInit = function mailgoInit() {
var _config, _config2;
// translations
var _ref = i18n_namespaceObject,
var _ref = i18n,
translations = _ref.translations; // if a default language is defined use it
if (((_config = config) === null || _config === void 0 ? void 0 : _config.lang) && i18n["languages"].includes(config.lang)) {
if (((_config = config) === null || _config === void 0 ? void 0 : _config.lang) && i18n.languages.includes(config.lang)) {
lang = config.lang;
} // if is defined <html lang=""> use it!
@@ -304,7 +301,7 @@ var mailgo_mailgoInit = function mailgoInit() {
// keep the lang from html
var htmlLang = document.documentElement.lang; // if there are translations...
if (i18n["languages"].includes(htmlLang)) {
if (i18n.languages.includes(htmlLang)) {
lang = document.documentElement.lang;
}
} // strings
@@ -1108,16 +1105,16 @@ function mailgo(mailgoConfig) {
if ((_config9 = config) === null || _config9 === void 0 ? void 0 : _config9.listenerOptions) {
// listener options specified
document.addEventListener(config.initEvent, function () {
mailgo_mailgoInit();
mailgoInit();
}, config.listenerOptions);
} else {
// no listener options
document.addEventListener(config.initEvent, function () {
mailgo_mailgoInit();
mailgoInit();
});
}
} else {
mailgo_mailgoInit();
mailgoInit();
}
}
}

File diff suppressed because one or more lines are too long