Explorar o código

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

Not to detect user lang when running in Node
Yifei Zhang %!s(int64=2) %!d(string=hai) anos
pai
achega
697c7a8dfe
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      app/locales/index.ts

+ 3 - 0
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 {