refactor: introduce trString for frontend (#38741)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
wxiaoguang
2026-08-03 04:40:02 +00:00
committed by GitHub
co-authored by silverwind delvh
parent cb4c65f035
commit c2ebe3724f
12 changed files with 51 additions and 21 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import {toggleElem} from '../utils/dom.ts';
import {showFomanticModal} from '../modules/fomantic/modal.ts';
import {trString} from '../modules/i18n.ts';
export function initRepoBranchButton() {
initRepoCreateBranchButton();
@@ -36,7 +37,7 @@ function initRepoRenameBranchButton() {
toggleElem(warn, el.getAttribute('data-is-default-branch') === 'true');
const text = modal.querySelector('[data-rename-branch-to]')!;
text.textContent = text.getAttribute('data-rename-branch-to')!.replace('%s', oldBranchName);
text.textContent = trString(text.getAttribute('data-rename-branch-to')!, oldBranchName);
});
}
}