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

@@ -202,13 +202,7 @@
"statistics": "Statistiken" "statistics": "Statistiken"
}, },
"search": { "search": {
"placeholder": "Suchen...", "placeholder": "Suchen",
"placeholders": {
"loras": "LoRAs suchen...",
"recipes": "Rezepte suchen...",
"checkpoints": "Checkpoints suchen...",
"embeddings": "Embeddings suchen..."
},
"options": "Suchoptionen", "options": "Suchoptionen",
"searchIn": "Suchen in:", "searchIn": "Suchen in:",
"notAvailable": "Suche auf Statistikseite nicht verfügbar", "notAvailable": "Suche auf Statistikseite nicht verfügbar",

View File

@@ -202,13 +202,7 @@
"statistics": "Stats" "statistics": "Stats"
}, },
"search": { "search": {
"placeholder": "Search...", "placeholder": "Search",
"placeholders": {
"loras": "Search LoRAs...",
"recipes": "Search recipes...",
"checkpoints": "Search checkpoints...",
"embeddings": "Search embeddings..."
},
"options": "Search Options", "options": "Search Options",
"searchIn": "Search In:", "searchIn": "Search In:",
"notAvailable": "Search not available on statistics page", "notAvailable": "Search not available on statistics page",

View File

@@ -202,13 +202,7 @@
"statistics": "Estadísticas" "statistics": "Estadísticas"
}, },
"search": { "search": {
"placeholder": "Buscar...", "placeholder": "Buscar",
"placeholders": {
"loras": "Buscar LoRAs...",
"recipes": "Buscar recetas...",
"checkpoints": "Buscar checkpoints...",
"embeddings": "Buscar embeddings..."
},
"options": "Opciones de búsqueda", "options": "Opciones de búsqueda",
"searchIn": "Buscar en:", "searchIn": "Buscar en:",
"notAvailable": "Búsqueda no disponible en la página de estadísticas", "notAvailable": "Búsqueda no disponible en la página de estadísticas",

View File

@@ -202,13 +202,7 @@
"statistics": "Statistiques" "statistics": "Statistiques"
}, },
"search": { "search": {
"placeholder": "Rechercher...", "placeholder": "Rechercher",
"placeholders": {
"loras": "Rechercher des LoRAs...",
"recipes": "Rechercher des recipes...",
"checkpoints": "Rechercher des checkpoints...",
"embeddings": "Rechercher des embeddings..."
},
"options": "Options de recherche", "options": "Options de recherche",
"searchIn": "Rechercher dans :", "searchIn": "Rechercher dans :",
"notAvailable": "Recherche non disponible sur la page de statistiques", "notAvailable": "Recherche non disponible sur la page de statistiques",

View File

@@ -202,13 +202,7 @@
"statistics": "סטטיסטיקה" "statistics": "סטטיסטיקה"
}, },
"search": { "search": {
"placeholder": פש...", "placeholder": יפוש",
"placeholders": {
"loras": "חפש LoRAs...",
"recipes": "חפש מתכונים...",
"checkpoints": "חפש checkpoints...",
"embeddings": "חפש embeddings..."
},
"options": "אפשרויות חיפוש", "options": "אפשרויות חיפוש",
"searchIn": "חפש ב:", "searchIn": "חפש ב:",
"notAvailable": "חיפוש לא זמין בדף הסטטיסטיקה", "notAvailable": "חיפוש לא זמין בדף הסטטיסטיקה",

View File

@@ -202,13 +202,7 @@
"statistics": "統計" "statistics": "統計"
}, },
"search": { "search": {
"placeholder": "検索...", "placeholder": "検索",
"placeholders": {
"loras": "LoRAを検索...",
"recipes": "レシピを検索...",
"checkpoints": "checkpointを検索...",
"embeddings": "embeddingを検索..."
},
"options": "検索オプション", "options": "検索オプション",
"searchIn": "検索対象:", "searchIn": "検索対象:",
"notAvailable": "統計ページでは検索は利用できません", "notAvailable": "統計ページでは検索は利用できません",

View File

@@ -202,13 +202,7 @@
"statistics": "통계" "statistics": "통계"
}, },
"search": { "search": {
"placeholder": "검색...", "placeholder": "검색",
"placeholders": {
"loras": "LoRA 검색...",
"recipes": "레시피 검색...",
"checkpoints": "Checkpoint 검색...",
"embeddings": "Embedding 검색..."
},
"options": "검색 옵션", "options": "검색 옵션",
"searchIn": "검색 범위:", "searchIn": "검색 범위:",
"notAvailable": "통계 페이지에서는 검색을 사용할 수 없습니다", "notAvailable": "통계 페이지에서는 검색을 사용할 수 없습니다",

View File

@@ -202,13 +202,7 @@
"statistics": "Статистика" "statistics": "Статистика"
}, },
"search": { "search": {
"placeholder": "Поиск...", "placeholder": "Поиск",
"placeholders": {
"loras": "Поиск LoRAs...",
"recipes": "Поиск рецептов...",
"checkpoints": "Поиск checkpoints...",
"embeddings": "Поиск embeddings..."
},
"options": "Опции поиска", "options": "Опции поиска",
"searchIn": "Искать в:", "searchIn": "Искать в:",
"notAvailable": "Поиск недоступен на странице статистики", "notAvailable": "Поиск недоступен на странице статистики",

View File

@@ -202,13 +202,7 @@
"statistics": "统计" "statistics": "统计"
}, },
"search": { "search": {
"placeholder": "搜索...", "placeholder": "搜索",
"placeholders": {
"loras": "搜索 LoRA...",
"recipes": "搜索配方...",
"checkpoints": "搜索 Checkpoint...",
"embeddings": "搜索 Embedding..."
},
"options": "搜索选项", "options": "搜索选项",
"searchIn": "搜索范围:", "searchIn": "搜索范围:",
"notAvailable": "统计页面不可用搜索", "notAvailable": "统计页面不可用搜索",

View File

@@ -202,13 +202,7 @@
"statistics": "統計" "statistics": "統計"
}, },
"search": { "search": {
"placeholder": "搜尋...", "placeholder": "搜尋",
"placeholders": {
"loras": "搜尋 LoRA...",
"recipes": "搜尋配方...",
"checkpoints": "搜尋 checkpoint...",
"embeddings": "搜尋 embedding..."
},
"options": "搜尋選項", "options": "搜尋選項",
"searchIn": "搜尋範圍:", "searchIn": "搜尋範圍:",
"notAvailable": "統計頁面無法搜尋", "notAvailable": "統計頁面無法搜尋",

View File

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

View File

@@ -45,8 +45,7 @@
<!-- Center section: Search --> <!-- Center section: Search -->
{% set search_disabled = current_page == 'statistics' %} {% set search_disabled = current_page == 'statistics' %}
{% set search_placeholder_key = 'header.search.notAvailable' if search_disabled else 'header.search.placeholders.' ~ {% set search_placeholder_key = 'header.search.notAvailable' if search_disabled else 'header.search.placeholder' %}
current_page %}
{% set header_search_class = 'header-search disabled' if search_disabled else 'header-search' %} {% set header_search_class = 'header-search disabled' if search_disabled else 'header-search' %}
<div class="{{ header_search_class }}" id="headerSearch"> <div class="{{ header_search_class }}" id="headerSearch">
<div class="search-container"> <div class="search-container">