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

View File

@@ -66,6 +66,9 @@ function setItem(key: string, value: string) {
} }
function getLanguage() { function getLanguage() {
if (typeof process === "object") {
return DEFAULT_LANG;
}
try { try {
return navigator.language.toLowerCase(); return navigator.language.toLowerCase();
} catch { } catch {