require instead of import in i18n
This commit is contained in:
parent
8caa841de1
commit
d35c3594fe
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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
|
@ -6,7 +6,7 @@ import {
|
|||
} from "mailgo";
|
||||
|
||||
// i18n for mailgo
|
||||
import * as i18n from "../i18n/i18n.json";
|
||||
const i18n: MailgoI18n = require("../i18n/i18n.json");
|
||||
|
||||
// mailgo scss
|
||||
const mailgoCSS: string = require("./mailgo.scss").toString();
|
||||
|
|
|
@ -12,9 +12,12 @@
|
|||
"declaration": true
|
||||
},
|
||||
"include": [
|
||||
"src",
|
||||
"mailgo.d.ts",
|
||||
"src",
|
||||
"webpack/mailgo.lib.ts",
|
||||
"webpack/mailgo.dist.ts"
|
||||
"webpack/mailgo.dist.ts",
|
||||
"webpack/mailgo.dist.dark.ts",
|
||||
"webpack/mailgo.firefox.ts",
|
||||
"webpack/mailgo.chrome.ts"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue