Fix unknown locales

This commit is contained in:
Alex
2024-05-20 18:50:56 +02:00
parent 705d05ce1e
commit 2eecf3ccfa
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
- Fix responsive layout on dashboard
- Fix presenter layout with embeds when messages are hidden
- Fix missing stream for form submits
- Fix unknown locales
## v2.0.0

View File

@@ -21,9 +21,16 @@ import Split from "split-grid";
import { TourGuideClient } from "@sjmc11/tourguidejs/src/Tour";
window.moment = moment;
const locale =
const supportedLocales = ["en", "fr", "de", "es"];
var locale =
document.querySelector("html").getAttribute("lang") ||
navigator.language.split("-")[0];
if (!supportedLocales.includes(locale)) {
locale = "en";
}
window.moment.locale("en");
window.moment.locale(locale);
window.Alpine = Alpine;