From 782718c293cf3201b69558ca47fff2eaaeef0192 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Fri, 28 Jun 2024 12:59:54 -0700 Subject: [PATCH] make i18n debugging an optional env setting this also reduces output noise in tests --- .env | 3 ++- .env.development | 3 ++- src/plugins/i18n.ts | 2 +- src/vite.env.d.ts | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 6ac42ba97b4..c712772022e 100644 --- a/.env +++ b/.env @@ -1,3 +1,4 @@ VITE_BYPASS_LOGIN=0 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=http://localhost:8001 \ No newline at end of file +VITE_SERVER_URL=http://localhost:8001 +VITE_I18N_DEBUG=0 \ No newline at end of file diff --git a/.env.development b/.env.development index e9180f0875d..52e8025ef57 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,4 @@ VITE_BYPASS_LOGIN=1 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=http://localhost:8001 \ No newline at end of file +VITE_SERVER_URL=http://localhost:8001 +VITE_I18N_DEBUG=1 \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 3bcac101465..b6f242f3e89 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -100,7 +100,7 @@ export async function initI18n(): Promise { detection: { lookupLocalStorage: "prLang" }, - debug: true, + debug: Number(import.meta.env.VITE_I18N_DEBUG) === 1, interpolation: { escapeValue: false, }, diff --git a/src/vite.env.d.ts b/src/vite.env.d.ts index b588b5b1145..c50158bf5a9 100644 --- a/src/vite.env.d.ts +++ b/src/vite.env.d.ts @@ -5,6 +5,7 @@ interface ImportMetaEnv { readonly VITE_BYPASS_TUTORIAL?: string; readonly VITE_API_BASE_URL?: string; readonly VITE_SERVER_URL?: string; + readonly VITE_I18N_DEBUG?: string; } interface ImportMeta {