Files
Petrus Han 0871e8ace3 feat: 完成 i18n 国际化、配置常量提取和版本选择功能
主要变更:
- 实现完整的 i18n 国际化系统,支持中英文双语
- 提取所有硬编码配置为全局常量(config.py)
- 添加 Helm Chart 版本选择功能,支持从 index.yaml 获取版本列表
- 实现倒序版本显示(最旧版本编号最大,最新版本编号为1)
- 修复 Helm 命令构建问题(--version 参数作为独立参数)
- 所有代码注释改为英文
- 模块化重构,提高代码可维护性

新增文件:
- config.py: 全局配置常量
- i18n/: 国际化模块
- modules/: 配置模块
- utils/: 工具模块
- docs/: 文档目录
- version_manager.py: 版本管理模块

修改文件:
- generate-values-prd.py: 主入口,添加语言和版本选择
- generator.py: 核心生成器类
- .gitignore: 更新忽略规则
2025-11-24 11:14:19 +08:00

48 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Terminal colors and print utilities"""
class Colors:
"""Terminal colors"""
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def print_header(text: str):
"""Print header"""
print(f"\n{Colors.HEADER}{Colors.BOLD}{'='*60}{Colors.ENDC}")
print(f"{Colors.HEADER}{Colors.BOLD}{text:^60}{Colors.ENDC}")
print(f"{Colors.HEADER}{Colors.BOLD}{'='*60}{Colors.ENDC}\n")
def print_section(text: str):
"""Print section"""
print(f"\n{Colors.OKCYAN}{Colors.BOLD}>>> {text}{Colors.ENDC}")
def print_info(text: str):
"""Print info"""
print(f"{Colors.OKBLUE} {text}{Colors.ENDC}")
def print_success(text: str):
"""Print success message"""
print(f"{Colors.OKGREEN}{text}{Colors.ENDC}")
def print_warning(text: str):
"""Print warning"""
print(f"{Colors.WARNING}{text}{Colors.ENDC}")
def print_error(text: str):
"""Print error"""
print(f"{Colors.FAIL}{text}{Colors.ENDC}")