瀏覽代碼

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

Not to detect user lang when running in Node
Yifei Zhang 2 年之前
父節點
當前提交
697c7a8dfe
共有 1 個文件被更改,包括 3 次插入0 次删除
  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 {