From b36fea002e3e9522bc39db1af75a4f81e6b69c06 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Sat, 30 Aug 2025 22:32:44 +0800 Subject: [PATCH] Add localization support for new features and update existing translations - Added "unknown" status to model states in English and Chinese locales. - Introduced new actions for checking updates and support in both locales. - Added settings for Civitai API key with help text in both locales. - Updated context menus and control components to use localized strings. - Enhanced help and support modals with localization. - Updated update modal to reflect current and new version information in localized format. - Refactored various templates to utilize the translation function for better internationalization. --- locales/en.json | 46 +++++++++- locales/zh-CN.json | 52 ++++++++++-- templates/checkpoints.html | 20 ++--- templates/components/context_menu.html | 38 ++++----- templates/components/controls.html | 84 +++++++++---------- templates/components/header.html | 10 +-- templates/components/modals/help_modal.html | 10 +-- .../components/modals/settings_modal.html | 32 +++---- .../components/modals/support_modal.html | 8 +- templates/components/modals/update_modal.html | 8 +- templates/embeddings.html | 20 ++--- templates/recipes.html | 16 ++-- 12 files changed, 210 insertions(+), 134 deletions(-) diff --git a/locales/en.json b/locales/en.json index 9561eda4..5700ade9 100644 --- a/locales/en.json +++ b/locales/en.json @@ -57,7 +57,8 @@ "failed": "Failed", "cancelled": "Cancelled", "pending": "Pending", - "ready": "Ready" + "ready": "Ready", + "unknown": "Unknown" }, "language": { "current": "Language", @@ -115,8 +116,17 @@ "switchToLight": "Switch to light theme", "switchToDark": "Switch to dark theme", "switchToAuto": "Switch to auto theme" + }, + "actions": { + "checkUpdates": "Check Updates", + "support": "Support" } }, + "settings": { + "civitaiApiKey": "Civitai API Key", + "civitaiApiKeyPlaceholder": "Enter your Civitai API key", + "civitaiApiKeyHelp": "Used for authentication when downloading models from Civitai" + }, "loras": { "title": "LoRA Models", "controls": { @@ -141,11 +151,14 @@ "download": "Download from URL", "bulk": "Bulk Operations", "duplicates": "Find Duplicates", - "favorites": "Show Favorites Only" + "favorites": "Show Favorites Only", + "filterActive": "Filter Active" }, "bulkOperations": { "title": "Bulk Operations", "selected": "{count} selected", + "selectedSuffix": "selected", + "viewSelected": "Click to view selected items", "sendToWorkflow": "Send all selected LoRAs to workflow", "copyAll": "Copy all selected LoRAs syntax", "refreshAll": "Refresh CivitAI metadata for selected models", @@ -161,7 +174,7 @@ "copyRecipeSyntax": "Copy Recipe Syntax", "sendToWorkflowAppend": "Send to Workflow (Append)", "sendToWorkflowReplace": "Send to Workflow (Replace)", - "openExamplesFolder": "Open Examples Folder", + "openExamples": "Open Examples Folder", "downloadExamples": "Download Example Images", "replacePreview": "Replace Preview", "setContentRating": "Set Content Rating", @@ -448,6 +461,31 @@ "search": "Search models by name, tags, or other criteria", "filter": "Filter models by various criteria", "sort": "Sort models by different attributes", - "backToTop": "Scroll back to top of page" + "tooltiptext": "Scroll back to top of page" + }, + "help": { + "title": "Help & Tutorials", + "tabs": { + "gettingStarted": "Getting Started", + "updateVlogs": "Update Vlogs", + "documentation": "Documentation" + }, + "gettingStarted": { + "title": "Getting Started with LoRA Manager" + } + }, + "update": { + "title": "Check for Updates", + "currentVersion": "Current Version", + "newVersion": "New Version", + "commit": "Commit" + }, + "support": { + "title": "Support the Project", + "message": "If you find LoRA Manager useful, I'd really appreciate your support! 🙌", + "feedback": { + "title": "Provide Feedback", + "description": "Your feedback helps shape future updates! Share your thoughts:" + } } } diff --git a/locales/zh-CN.json b/locales/zh-CN.json index ef91a1f8..186a046a 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -57,7 +57,8 @@ "failed": "失败", "cancelled": "已取消", "pending": "等待中", - "ready": "就绪" + "ready": "就绪", + "unknown": "未知" }, "language": { "current": "语言", @@ -115,8 +116,17 @@ "switchToLight": "切换到浅色主题", "switchToDark": "切换到深色主题", "switchToAuto": "切换到自动主题" + }, + "actions": { + "checkUpdates": "检查更新", + "support": "支持" } }, + "settings": { + "civitaiApiKey": "Civitai API 密钥", + "civitaiApiKeyPlaceholder": "输入您的 Civitai API 密钥", + "civitaiApiKeyHelp": "用于从 Civitai 下载模型时的身份验证" + }, "loras": { "title": "LoRA", "controls": { @@ -141,16 +151,19 @@ "download": "从 URL 下载", "bulk": "批量操作", "duplicates": "查找重复项", - "favorites": "仅显示收藏" + "favorites": "仅显示收藏", + "filterActive": "筛选器已激活" }, "bulkOperations": { "title": "批量操作", "selected": "已选择{count}项", + "selectedSuffix": "已选择", + "viewSelected": "点击查看选中项目", "sendToWorkflow": "发送到工作流", - "copyAll": "复制LoRA语法", - "refreshAll": "刷新元数据", - "moveAll": "移动", - "deleteAll": "删除", + "copyAll": "复制所有选中的LoRA语法", + "refreshAll": "刷新选中模型的Civitai元数据", + "moveAll": "移动选中模型到文件夹", + "deleteAll": "删除选中模型", "clear": "清除选择" }, "contextMenu": { @@ -161,7 +174,7 @@ "copyRecipeSyntax": "复制配方语法", "sendToWorkflowAppend": "发送到工作流(追加)", "sendToWorkflowReplace": "发送到工作流(替换)", - "openExamplesFolder": "打开示例文件夹", + "openExamples": "打开示例文件夹", "downloadExamples": "下载示例图片", "replacePreview": "替换预览图", "setContentRating": "设置内容评级", @@ -449,5 +462,30 @@ "filter": "按各种条件筛选模型", "sort": "按不同属性排序模型", "backToTop": "滚动回页面顶部" + }, + "help": { + "title": "帮助与教程", + "tabs": { + "gettingStarted": "快速入门", + "updateVlogs": "更新日志", + "documentation": "文档" + }, + "gettingStarted": { + "title": "LoRA 管理器快速入门" + } + }, + "update": { + "title": "检查更新", + "currentVersion": "当前版本", + "newVersion": "新版本", + "commit": "提交" + }, + "support": { + "title": "支持项目", + "message": "如果您觉得 LoRA 管理器有用,我会非常感谢您的支持!🙌", + "feedback": { + "title": "提供反馈", + "description": "您的反馈有助于塑造未来的更新!分享您的想法:" + } } } diff --git a/templates/checkpoints.html b/templates/checkpoints.html index 1ad4857a..36950b0a 100644 --- a/templates/checkpoints.html +++ b/templates/checkpoints.html @@ -14,17 +14,17 @@ {% block additional_components %} {% endblock %} diff --git a/templates/components/context_menu.html b/templates/components/context_menu.html index 696d1b63..ff488290 100644 --- a/templates/components/context_menu.html +++ b/templates/components/context_menu.html @@ -6,57 +6,57 @@ View on Civitai -->
- Refresh Civitai Data + {{ t('loras.contextMenu.refreshMetadata') }}
- Re-link to Civitai + {{ t('loras.contextMenu.relinkCivitai') }}
- Copy LoRA Syntax + {{ t('loras.contextMenu.copySyntax') }}
- Send to Workflow (Append) + {{ t('loras.contextMenu.sendToWorkflowAppend') }}
- Send to Workflow (Replace) + {{ t('loras.contextMenu.sendToWorkflowReplace') }}
- Open Examples Folder + {{ t('loras.contextMenu.openExamples') }}
- Download Example Images + {{ t('loras.contextMenu.downloadExamples') }}
- Replace Preview + {{ t('loras.contextMenu.replacePreview') }}
- Set Content Rating + {{ t('loras.contextMenu.setContentRating') }}
- Move to Folder + {{ t('loras.contextMenu.moveToFolder') }}
- Exclude Model + {{ t('loras.contextMenu.excludeModel') }}
- Delete Model + {{ t('loras.contextMenu.deleteModel') }}
-

Set Content Rating

+

{{ t('modals.contentRating.title') }}

-
Current: Unknown
+
{{ t('modals.contentRating.current') }}: {{ t('common.status.unknown') }}
- - - - - + + + + +
diff --git a/templates/components/controls.html b/templates/components/controls.html index a4118cd2..bc4bd157 100644 --- a/templates/components/controls.html +++ b/templates/components/controls.html @@ -1,59 +1,59 @@
-
+
-