From bb80e8b4607763950ce8fd6f4ab289149cedb831 Mon Sep 17 00:00:00 2001 From: 1e99 <1e99@1e99.eu> Date: Sun, 10 Nov 2024 10:53:53 +0100 Subject: [PATCH] fix languages --- main.go | 1 - static/js/lang.js | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index a848d9f..ae9844b 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,6 @@ import ( ) //go:embed static/* -//go:embed static/*/* var embedFS embed.FS func run() error { diff --git a/static/js/lang.js b/static/js/lang.js index 76488ac..01e455e 100644 --- a/static/js/lang.js +++ b/static/js/lang.js @@ -61,10 +61,11 @@ function initLanguageButtons() { } window.addEventListener("load", async () => { - const lang = localStorage.getItem(LANGUAGE_KEY); - if (lang != null) { - await setLanguage(lang); + let lang = localStorage.getItem(LANGUAGE_KEY); + if (lang == null) { + lang = "en"; } + await setLanguage(lang); initLanguageButtons(); });