ruki пре 2 недеља
родитељ
комит
7c4e838c64
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      docs/.vitepress/theme/index.ts

+ 7 - 0
docs/.vitepress/theme/index.ts

@@ -49,6 +49,13 @@ export default {
     // Register global components
     app.component('AIAssistant', AIAssistant)
     
+    if (typeof window !== 'undefined') {
+      const lang = navigator.language
+      if (lang && lang.toLowerCase().startsWith('zh') && window.location.pathname === '/') {
+        window.location.pathname = '/zh/'
+      }
+    }
+
     router.onBeforeRouteChange = (to) => {
       const u = new URL(to, 'https://xmake.io')
       if (u.pathname === '/') {