Merge pull request #2692 from flx-sta/feature/i18n-debugging

[Feature][ENV] make i18n debugging an optional env setting
This commit is contained in:
Tempoanon 2024-07-10 17:20:43 -04:00 committed by GitHub
commit fc4b97d7ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 3 deletions

1
.env
View File

@ -3,3 +3,4 @@ VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=http://localhost:8001
VITE_DISCORD_CLIENT_ID=1248062921129459756
VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com
VITE_I18N_DEBUG=0

View File

@ -3,3 +3,4 @@ VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=https://api.beta.pokerogue.net
VITE_DISCORD_CLIENT_ID=1248062921129459756
VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com
VITE_I18N_DEBUG=1

View File

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

View File

@ -3,3 +3,4 @@ VITE_BYPASS_TUTORIAL=0
VITE_SERVER_URL=https://api.pokerogue.net
VITE_DISCORD_CLIENT_ID=1248062921129459756
VITE_GOOGLE_CLIENT_ID=955345393540-2k6lfftf0fdnb0krqmpthjnqavfvvf73.apps.googleusercontent.com
VITE_I18N_DEBUG=0

View File

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

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

@ -7,6 +7,7 @@ interface ImportMetaEnv {
readonly VITE_SERVER_URL?: string;
readonly VITE_DISCORD_CLIENT_ID?: string;
readonly VITE_GOOGLE_CLIENT_ID?: string;
readonly VITE_I18N_DEBUG?: string;
}
interface ImportMeta {