From 46f087967705379bd64a2bd2a45084529b836f1a Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 7 Aug 2022 22:53:29 +0200 Subject: [PATCH] feat: add defaultLocale in config.json (#1010) Co-authored-by: th33xitus --- public/config.json | 1 + src/locales/de.json | 1 + src/main.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/public/config.json b/public/config.json index e782b5c4..26ac427f 100644 --- a/public/config.json +++ b/public/config.json @@ -1,4 +1,5 @@ { + "defaultLocale": "en", "hostname": null, "port": null, "instancesDB": "moonraker", diff --git a/src/locales/de.json b/src/locales/de.json index ec277c6c..a38b7cac 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -111,6 +111,7 @@ "CheckMoonrakerLog": "Wenn diese Meldung wiederholt erscheint, schaue bitte in die Logdatei unter:", "Connecting": "Verbinde zu {host}", "Failed": "Verbindung fehlgeschlagen", + "Initializing": "Initialisieren", "TryAgain": "Erneut versuchen" }, "Console": { diff --git a/src/main.ts b/src/main.ts index 452fd1cc..4003d2bc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -82,6 +82,7 @@ const initLoad = async () => { window.console.debug('Loaded config.json') await store.dispatch('importConfigJson', file) + if ('defaultLocale' in file) i18n.locale = file.defaultLocale }) .catch((_) => { window.console.error('config.json not found or cannot be decoded!')