Skip to content

Commit

Permalink
Enhance language handling in workflow fixer HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
jammyfu committed Jan 22, 2025
1 parent 4a1c714 commit 9f6dfe1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/fix/workflow_fixer.html
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ <h1 id="title">PaintingCoder Workflow Fixer</h1>
if (lang && (lang === 'zh' || lang === 'en')) {
currentLanguage = lang;
updateLanguage();
} else {
// 如果没有语言参数,根据当前语言设置URL
const url = new URL(window.location.href);
url.searchParams.set('lang', currentLanguage);
window.history.replaceState({}, '', url.toString());
}
}

Expand Down Expand Up @@ -415,7 +420,15 @@ <h1 id="title">PaintingCoder Workflow Fixer</h1>
let currentLanguage = 'en';

function toggleLanguage() {
// 切换语言
currentLanguage = currentLanguage === 'en' ? 'zh' : 'en';

// 更新 URL 参数
const url = new URL(window.location.href);
url.searchParams.set('lang', currentLanguage);
window.history.replaceState({}, '', url.toString());

// 更新页面语言
updateLanguage();
}

Expand Down

0 comments on commit 9f6dfe1

Please sign in to comment.