File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 263263 script . setAttribute ( 'data-input-position' , 'bottom' ) ;
264264 script . setAttribute ( 'data-theme' , currentTheme === 'dark' ? 'dark' : 'light' ) ;
265265
266- // Set language based on path
266+ // Set language based on path - only Chinese pages should be marked as Chinese
267267 const isChinesePage = newPath . includes ( '/zh-CN/' ) || newPath . includes ( '/cn/' ) ;
268- script . setAttribute ( 'data-lang' , isChinesePage ? 'zh-CN' : 'en' ) ;
268+ const giscusLang = isChinesePage ? 'zh-CN' : 'en' ;
269+ script . setAttribute ( 'data-lang' , giscusLang ) ;
270+
271+ // Debug logging
272+ console . log ( 'Giscus: Current path:' , newPath ) ;
273+ console . log ( 'Giscus: Is Chinese page:' , isChinesePage ) ;
274+ console . log ( 'Giscus: Language set to:' , giscusLang ) ;
269275 script . setAttribute ( 'crossorigin' , 'anonymous' ) ;
270276 script . async = true ;
271277
You can’t perform that action at this time.
0 commit comments