refactor(ui): unify search bar placeholder to i18n key header.search.placeholder

- Replace page-specific header.search.placeholders.* keys with a single
  header.search.placeholder key (value: "Search", no ellipsis)
- Keep header.search.notAvailable for the statistics page
- Remove unused placeholder/placeholders/notAvailable entries from all
  10 locale files; preserve options and searchIn keys
- Update Jinja template and JS header to use the new unified key
This commit is contained in:
Will Miao
2026-06-24 20:30:38 +08:00
parent 8052cefd46
commit ea14d211be
12 changed files with 12 additions and 74 deletions

View File

@@ -338,7 +338,6 @@ export class HeaderManager {
const headerSearch = document.getElementById('headerSearch');
const searchInput = headerSearch?.querySelector('#searchInput');
const searchButtons = headerSearch?.querySelectorAll('button');
const placeholderKey = 'header.search.placeholders.' + this.currentPage;
if (this.currentPage === 'statistics' && headerSearch) {
headerSearch.classList.add('disabled');
@@ -353,7 +352,7 @@ export class HeaderManager {
if (searchInput) {
searchInput.disabled = false;
// Use i18nHelpers to update placeholder
updateElementAttribute(searchInput, 'placeholder', placeholderKey, {}, '');
updateElementAttribute(searchInput, 'placeholder', 'header.search.placeholder', {}, '');
}
searchButtons?.forEach(btn => btn.disabled = false);
}