go on with i18n
This commit is contained in:
parent
13e8e9e828
commit
01fc4f1447
2
dist/mailgo.min.js
vendored
2
dist/mailgo.min.js
vendored
File diff suppressed because one or more lines are too long
@ -38,7 +38,12 @@ function js() {
|
|||||||
.pipe(replace(MAILGO_STYLE_TAG, cssMinContent))
|
.pipe(replace(MAILGO_STYLE_TAG, cssMinContent))
|
||||||
.pipe(tsProject())
|
.pipe(tsProject())
|
||||||
// .pipe(babel())
|
// .pipe(babel())
|
||||||
.pipe(dest("./"))
|
.pipe(
|
||||||
|
rename({
|
||||||
|
suffix: ".m",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.pipe(dest("src"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/manzinello/mailgo.git"
|
"url": "git+https://github.com/manzinello/mailgo.git"
|
||||||
},
|
},
|
||||||
"main": "./mailgo.js",
|
"main": "./mailgo.m.js",
|
||||||
"module": "./mailgo.js",
|
"module": "./mailgo.m.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"mailto",
|
"mailto",
|
||||||
"mail",
|
"mail",
|
||||||
|
@ -35,6 +35,9 @@ const mailgoInit = (mailgoConfig) => {
|
|||||||
i18n.languages.includes(mailgoConfig.defaultLang)) {
|
i18n.languages.includes(mailgoConfig.defaultLang)) {
|
||||||
lang = mailgoConfig.defaultLang;
|
lang = mailgoConfig.defaultLang;
|
||||||
}
|
}
|
||||||
|
if (!mailgoConfig.forceLang) {
|
||||||
|
lang = document.documentElement.lang;
|
||||||
|
}
|
||||||
// strings
|
// strings
|
||||||
let strings = translations[lang];
|
let strings = translations[lang];
|
||||||
// mailgo mail
|
// mailgo mail
|
@ -1,5 +1,5 @@
|
|||||||
// import mailgo
|
// import mailgo
|
||||||
import mailgo from "../mailgo";
|
import mailgo from "./mailgo.m.js";
|
||||||
|
|
||||||
// call init mailgo attached to the event DOMContentLoaded
|
// call init mailgo attached to the event DOMContentLoaded
|
||||||
|
|
||||||
|
@ -78,6 +78,11 @@ const mailgoInit = (mailgoConfig?: MailgoConfig): void => {
|
|||||||
lang = mailgoConfig.defaultLang;
|
lang = mailgoConfig.defaultLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if is defined <html lang=""> use it!
|
||||||
|
if (!mailgoConfig.forceLang && document.documentElement.lang) {
|
||||||
|
lang = document.documentElement.lang;
|
||||||
|
}
|
||||||
|
|
||||||
// strings
|
// strings
|
||||||
let strings: any = translations[lang];
|
let strings: any = translations[lang];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user