From 782718c293cf3201b69558ca47fff2eaaeef0192 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Fri, 28 Jun 2024 12:59:54 -0700 Subject: [PATCH 1/3] 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 { From e9295385690b8e64e4b5a82870c06392eec425b0 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Fri, 28 Jun 2024 13:02:55 -0700 Subject: [PATCH 2/3] set development default also to "0" --- .env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 52e8025ef57..52788095220 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ VITE_BYPASS_LOGIN=1 VITE_BYPASS_TUTORIAL=0 VITE_SERVER_URL=http://localhost:8001 -VITE_I18N_DEBUG=1 \ No newline at end of file +VITE_I18N_DEBUG=0 \ No newline at end of file From fab59921d6b763e7af3869f5c06eb9f5427f7831 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Wed, 10 Jul 2024 13:27:28 -0700 Subject: [PATCH 3/3] update VITE_I18N_DEBUG in .env files --- .env.beta | 3 ++- .env.development | 2 +- .env.production | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.beta b/.env.beta index 8d1e93b3277..eca670feab7 100644 --- a/.env.beta +++ b/.env.beta @@ -1,3 +1,4 @@ VITE_BYPASS_LOGIN=0 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=https://api.beta.pokerogue.net \ No newline at end of file +VITE_SERVER_URL=https://api.beta.pokerogue.net +VITE_I18N_DEBUG=1 \ No newline at end of file diff --git a/.env.development b/.env.development index 52788095220..52e8025ef57 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ VITE_BYPASS_LOGIN=1 VITE_BYPASS_TUTORIAL=0 VITE_SERVER_URL=http://localhost:8001 -VITE_I18N_DEBUG=0 \ No newline at end of file +VITE_I18N_DEBUG=1 \ No newline at end of file diff --git a/.env.production b/.env.production index 74818d41a12..d328b5bd43f 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,4 @@ VITE_BYPASS_LOGIN=0 VITE_BYPASS_TUTORIAL=0 -VITE_SERVER_URL=https://api.pokerogue.net \ No newline at end of file +VITE_SERVER_URL=https://api.pokerogue.net +VITE_I18N_DEBUG=0 \ No newline at end of file