make i18n debugging an optional env setting

this also reduces output noise in tests
This commit is contained in:
Felix Staud 2024-06-28 12:59:54 -07:00
parent 15671a6922
commit 782718c293
4 changed files with 6 additions and 3 deletions

3
.env
View File

@ -1,3 +1,4 @@
VITE_BYPASS_LOGIN=0 VITE_BYPASS_LOGIN=0
VITE_BYPASS_TUTORIAL=0 VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=http://localhost:8001 VITE_SERVER_URL=http://localhost:8001
VITE_I18N_DEBUG=0

View File

@ -1,3 +1,4 @@
VITE_BYPASS_LOGIN=1 VITE_BYPASS_LOGIN=1
VITE_BYPASS_TUTORIAL=0 VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=http://localhost:8001 VITE_SERVER_URL=http://localhost:8001
VITE_I18N_DEBUG=1

View File

@ -100,7 +100,7 @@ export async function initI18n(): Promise<void> {
detection: { detection: {
lookupLocalStorage: "prLang" lookupLocalStorage: "prLang"
}, },
debug: true, debug: Number(import.meta.env.VITE_I18N_DEBUG) === 1,
interpolation: { interpolation: {
escapeValue: false, escapeValue: false,
}, },

1
src/vite.env.d.ts vendored
View File

@ -5,6 +5,7 @@ interface ImportMetaEnv {
readonly VITE_BYPASS_TUTORIAL?: string; readonly VITE_BYPASS_TUTORIAL?: string;
readonly VITE_API_BASE_URL?: string; readonly VITE_API_BASE_URL?: string;
readonly VITE_SERVER_URL?: string; readonly VITE_SERVER_URL?: string;
readonly VITE_I18N_DEBUG?: string;
} }
interface ImportMeta { interface ImportMeta {