File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -130,8 +130,11 @@ class I18nCaseDetail {
130130 newContent = newContent . replace ( / [ ' " ] ❌ 未 能 完 全 绕 过 d e b u g g e r 断 点 [ ' " ] / ,
131131 `(window.currentLang === 'zh-CN' ? '❌ 未能完全绕过 debugger 断点' : '❌ Failed to completely bypass the debugger breakpoint')` ) ;
132132
133- // 在脚本开头添加当前语言变量
134- newContent = `window.currentLang = "${ currentLang } ";\n` + newContent ;
133+ // 处理变量重复声明问题
134+ newContent = newContent . replace ( / l e t \s + i s T e s t R u n n i n g / g, 'window.isTestRunning = window.isTestRunning ||' ) ;
135+
136+ // 在脚本开头添加当前语言变量(如果不存在)
137+ newContent = `if (typeof window.currentLang === 'undefined') { window.currentLang = "${ currentLang } "; }\n` + newContent ;
135138
136139 newScript . textContent = newContent ;
137140 script . parentNode . replaceChild ( newScript , script ) ;
You can’t perform that action at this time.
0 commit comments