Files
zccrs-comfyui-dci/py/utils
JiDe Zhang c3f166d067 feat: Add comprehensive internationalization (i18n) support
1. Created I18n utility class with automatic locale detection
2. Added translation files for English (en.json) and Chinese (zh-CN.json)
3. Implemented fallback mechanism (current locale -> English -> key itself)
4. Updated all node display names and categories to use i18n
5. Modified DCIAnalysis node to use translated metadata labels
6. Enhanced translation coverage for all UI elements and messages
7. Added support for system locale auto-detection

Key features:
- Singleton pattern for global i18n instance
- Automatic locale detection based on system settings
- Comprehensive translation keys for all nodes and metadata
- Clean separation of code and translatable strings
- Easy extensibility for additional languages

The system automatically detects Chinese/English environments and loads
appropriate translations, with English as fallback for missing keys.

功能:添加全面的国际化(i18n)支持

1. 创建了具有自动语言环境检测的 I18n 工具类
2. 添加了英文(en.json)和中文(zh-CN.json)翻译文件
3. 实现了回退机制(当前语言环境 -> 英文 -> 键本身)
4. 更新所有节点显示名称和类别以使用 i18n
5. 修改 DCIAnalysis 节点使用翻译的元数据标签
6. 增强了所有 UI 元素和消息的翻译覆盖
7. 添加了系统语言环境自动检测支持

主要特性:
- 全局 i18n 实例的单例模式
- 基于系统设置的自动语言环境检测
- 所有节点和元数据的全面翻译键
- 代码和可翻译字符串的清晰分离
- 易于扩展以支持其他语言

系统自动检测中文/英文环境并加载相应翻译,
对于缺失的键以英文作为回退。
2025-06-10 18:10:45 +08:00
..