Skip to content

Commit

Permalink
Fix unknown locales
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed May 20, 2024
1 parent 705d05c commit 2eecf3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 8 additions & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2eecf3c

Please sign in to comment.