Prechádzať zdrojové kódy

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.
Jingguo Yao 1 rok pred
rodič
commit
3f5a189591
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  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 {