From 3f5a189591319a90cebfb835c533a3538a99c507 Mon Sep 17 00:00:00 2001 From: Jingguo Yao Date: Sat, 20 May 2023 11:06:54 +0800 Subject: [PATCH] Not to detect user lang when running in Node Use DEFAULT_LANG with Node. Remove the logging on the server side: [Lang] failed to detect user lang. --- app/locales/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/locales/index.ts b/app/locales/index.ts index 22c417da5..7c88c0d22 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -66,6 +66,9 @@ function setItem(key: string, value: string) { } function getLanguage() { + if (typeof process === "object") { + return DEFAULT_LANG; + } try { return navigator.language.toLowerCase(); } catch {