earlier loading of language files
This commit is contained in:
@@ -27,12 +27,6 @@ document.addEventListener("alpine:init", () => {
|
|||||||
|
|
||||||
let appStrings = {};
|
let appStrings = {};
|
||||||
|
|
||||||
for (const lang in appLangs) {
|
|
||||||
const script = document.createElement("script");
|
|
||||||
script.src = `js/i18n/${lang}.js`;
|
|
||||||
document.head.appendChild(script);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener("alpine-i18n:ready", function () {
|
document.addEventListener("alpine-i18n:ready", function () {
|
||||||
AlpineI18n.create("en", appStrings);
|
AlpineI18n.create("en", appStrings);
|
||||||
AlpineI18n.fallbackLocale = "en";
|
AlpineI18n.fallbackLocale = "en";
|
||||||
|
@@ -2,3 +2,9 @@ const appLangs = {
|
|||||||
en: "English",
|
en: "English",
|
||||||
fr: "Français",
|
fr: "Français",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
for (const lang in appLangs) {
|
||||||
|
const script = document.createElement("script");
|
||||||
|
script.src = `js/i18n/${lang}.js`;
|
||||||
|
document.head.appendChild(script);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user