From a83f020fccefe7b9658432a6d5817c5a90a9488b Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sun, 31 Aug 2025 20:26:13 +0800 Subject: [PATCH] feat(localization): add file size labels and enhance search placeholders in UI components --- locales/en.json | 26 ++++++++++++++++++++++++-- static/js/managers/FilterManager.js | 2 +- templates/recipes.html | 2 +- test_i18n.py | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/locales/en.json b/locales/en.json index 7b26c8d1..6d476392 100644 --- a/locales/en.json +++ b/locales/en.json @@ -28,6 +28,14 @@ "korean": "한국어", "french": "Français", "spanish": "Español" + }, + "fileSize": { + "zero": "0 Bytes", + "bytes": "Bytes", + "kb": "KB", + "mb": "MB", + "gb": "GB", + "tb": "TB" } }, "modelCard": { @@ -74,8 +82,15 @@ }, "search": { "placeholder": "Search...", + "placeholders": { + "loras": "Search LoRAs...", + "recipes": "Search recipes...", + "checkpoints": "Search checkpoints...", + "embeddings": "Search embeddings..." + }, "options": "Search Options", "searchIn": "Search In:", + "notAvailable": "Search not available on statistics page", "filters": { "filename": "Filename", "modelname": "Model Name", @@ -93,7 +108,10 @@ "clearAll": "Clear All Filters" }, "theme": { - "toggle": "Toggle theme" + "toggle": "Toggle theme", + "switchToLight": "Switch to light theme", + "switchToDark": "Switch to dark theme", + "switchToAuto": "Switch to auto theme" }, "actions": { "checkUpdates": "Check Updates", @@ -165,7 +183,10 @@ "recipes": { "title": "LoRA Recipes", "controls": { - "import": "Import Recipe", + "import": { + "action": "Import Recipe", + "title": "Import a recipe from image or URL" + }, "refresh": { "title": "Refresh recipe list" }, @@ -691,6 +712,7 @@ "cacheClearError": "Error clearing cache: {message}" }, "filters": { + "applied": "{message}", "cleared": "Filters cleared" }, "downloads": { diff --git a/static/js/managers/FilterManager.js b/static/js/managers/FilterManager.js index 0794a25a..12c35c0d 100644 --- a/static/js/managers/FilterManager.js +++ b/static/js/managers/FilterManager.js @@ -282,7 +282,7 @@ export class FilterManager { message = `Filtering by ${tagsCount} tag${tagsCount > 1 ? 's' : ''}`; } - showToast('filters.applied', { message }, 'success'); + showToast('toast.filters.applied', { message }, 'success'); } } else { this.filterButton.classList.remove('active'); diff --git a/templates/recipes.html b/templates/recipes.html index c94606d5..ebf414e8 100644 --- a/templates/recipes.html +++ b/templates/recipes.html @@ -41,7 +41,7 @@