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.
This commit is contained in:
Jingguo Yao 2023-05-20 11:06:54 +08:00
parent bcb18ff2f4
commit 3f5a189591
1 changed files with 3 additions and 0 deletions

View File

@ -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 {