Merge pull request #1648 from yaojingguo/not-to-detect-user-lang-in-node

Not to detect user lang when running in Node
This commit is contained in:
Yifei Zhang 2023-05-20 16:07:18 +08:00 committed by GitHub
commit 697c7a8dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {