import i18n, fix error in examples
This commit is contained in:
parent
9ce11df0a8
commit
eb28125f51
2
dist/mailgo.dark.min.js
vendored
2
dist/mailgo.dark.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mailgo.dark.min.js.map
vendored
2
dist/mailgo.dark.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/mailgo.min.js
vendored
2
dist/mailgo.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mailgo.min.js.map
vendored
2
dist/mailgo.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="it">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>mailgo examples</title>
|
<title>mailgo examples</title>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="it">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>mailgo examples</title>
|
<title>mailgo examples</title>
|
||||||
|
@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
/* 0 */
|
/* 0 */
|
||||||
/***/ (function(module) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
module.exports = JSON.parse("{\"languages\":[\"en\",\"it\"],\"translations\":{\"en\":{\"open_in\":\"open in \",\"cc_\":\"cc \",\"bcc_\":\"bcc \",\"subject_\":\"subject \",\"body_\":\"body \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"call\",\"open\":\"open\",\"_default\":\" default\",\"_as_default\":\" as default\",\"copy\":\"copy\"},\"it\":{\"open_in\":\"apri con \",\"cc_\":\"cc \",\"bcc_\":\"ccn \",\"subject_\":\"oggetto \",\"body_\":\"testo \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"chiama\",\"open\":\"apri\",\"_default\":\" \",\"_as_default\":\" \",\"copy\":\"copia\"}}}");
|
module.exports = JSON.parse("{\"a\":[\"en\",\"it\"],\"b\":{\"en\":{\"open_in\":\"open in \",\"cc_\":\"cc \",\"bcc_\":\"bcc \",\"subject_\":\"subject \",\"body_\":\"body \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"call\",\"open\":\"open\",\"_default\":\" default\",\"_as_default\":\" as default\",\"copy\":\"copy\"},\"it\":{\"open_in\":\"apri con \",\"cc_\":\"cc \",\"bcc_\":\"ccn \",\"subject_\":\"oggetto \",\"body_\":\"testo \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"chiama\",\"open\":\"apri\",\"_default\":\" \",\"_as_default\":\" \",\"copy\":\"copia\"}}}");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 1 */
|
/* 1 */
|
||||||
@ -235,10 +235,12 @@ function toComment(sourceMap) {
|
|||||||
// ESM COMPAT FLAG
|
// ESM COMPAT FLAG
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
|
// EXTERNAL MODULE: ../i18n/i18n.json
|
||||||
|
var i18n = __webpack_require__(0);
|
||||||
|
|
||||||
// CONCATENATED MODULE: ../src/mailgo.ts
|
// CONCATENATED MODULE: ../src/mailgo.ts
|
||||||
// i18n for mailgo
|
// i18n for mailgo
|
||||||
var i18n = __webpack_require__(0); // mailgo scss
|
// mailgo scss
|
||||||
|
|
||||||
|
|
||||||
var mailgoCSS = __webpack_require__(1).toString(); // default lang
|
var mailgoCSS = __webpack_require__(1).toString(); // default lang
|
||||||
|
|
||||||
@ -277,13 +279,13 @@ var gmail, outlook, mailgo_open, telegram, wa, skype, call, copyMail, copyTel;
|
|||||||
* the function that creates the mailgo elements in DOM
|
* the function that creates the mailgo elements in DOM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var mailgoInit = function mailgoInit(mailgoConfig) {
|
var mailgo_mailgoInit = function mailgoInit(mailgoConfig) {
|
||||||
// default language
|
// default language
|
||||||
var lang = DEFAULT_LANG; // translations
|
var lang = DEFAULT_LANG; // translations
|
||||||
|
|
||||||
var translations = i18n.translations; // if a default language is defined use it
|
var translations = i18n["b" /* translations */]; // if a default language is defined use it
|
||||||
|
|
||||||
if ((mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.lang) && i18n.languages.includes(mailgoConfig.lang)) {
|
if ((mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.lang) && i18n["a" /* languages */].includes(mailgoConfig.lang)) {
|
||||||
lang = mailgoConfig.lang;
|
lang = mailgoConfig.lang;
|
||||||
} // if is defined <html lang=""> use it!
|
} // if is defined <html lang=""> use it!
|
||||||
|
|
||||||
@ -292,7 +294,7 @@ var mailgoInit = function mailgoInit(mailgoConfig) {
|
|||||||
// keep the lang from html
|
// keep the lang from html
|
||||||
var htmlLang = document.documentElement.lang; // if there are translations...
|
var htmlLang = document.documentElement.lang; // if there are translations...
|
||||||
|
|
||||||
if (i18n.languages.includes(htmlLang)) {
|
if (i18n["a" /* languages */].includes(htmlLang)) {
|
||||||
lang = document.documentElement.lang;
|
lang = document.documentElement.lang;
|
||||||
}
|
}
|
||||||
} // strings
|
} // strings
|
||||||
@ -1016,10 +1018,10 @@ function mailgo(mailgoConfig) {
|
|||||||
|
|
||||||
if (mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.initEvent) {
|
if (mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.initEvent) {
|
||||||
document.addEventListener(mailgoConfig.initEvent, function () {
|
document.addEventListener(mailgoConfig.initEvent, function () {
|
||||||
mailgoInit(mailgoConfig);
|
mailgo_mailgoInit(mailgoConfig);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
mailgoInit(mailgoConfig);
|
mailgo_mailgoInit(mailgoConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@ import {
|
|||||||
} from "mailgo";
|
} from "mailgo";
|
||||||
|
|
||||||
// i18n for mailgo
|
// i18n for mailgo
|
||||||
const i18n: MailgoI18n = require("../i18n/i18n.json");
|
import * as i18n from "../i18n/i18n.json";
|
||||||
|
|
||||||
// mailgo scss
|
// mailgo scss
|
||||||
const mailgoCSS: string = require("./mailgo.scss").toString();
|
const mailgoCSS: string = require("./mailgo.scss").toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user