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