Files
makemd/dashboard/fix_locale.py
wurenzhi e47beffaf9 feat: 重构前端代码结构并添加Java后端支持
- 重构前端导入和组件结构,优化代码组织
- 添加Java后端基础框架和API实现
- 修复类型定义和接口兼容性问题
- 新增测试页面和工具函数
- 优化国际化支持和错误处理
- 更新依赖配置和构建脚本

新增Java后端模块:
- 实现基础认证、订单、支付等服务
- 添加Swagger API文档支持
- 配置数据库连接和缓存
- 实现国际化消息处理
- 添加安全过滤器和限流控制
2026-03-30 16:51:18 +08:00

38 lines
891 B
Python

import re
with open('src/contexts/LocaleContext.tsx', 'r', encoding='utf-8') as f:
content = f.read()
lines = content.split('\n')
seen_keys = {}
new_lines = []
in_zhcn = False
in_enus = False
for line in lines:
if 'const zhCN = {' in line:
in_zhcn = True
in_enus = False
seen_keys = {}
elif 'const enUS = {' in line:
in_enus = True
in_zhcn = False
seen_keys = {}
match = re.match(r"^\s*'([^']+)':\s*'[^']*'", line)
if match:
key = match.group(1)
if key in seen_keys:
print(f'Duplicate: {key}')
continue
else:
seen_keys[key] = True
new_lines.append(line)
new_content = '\n'.join(new_lines)
with open('src/contexts/LocaleContext.tsx', 'w', encoding='utf-8') as f:
f.write(new_content)
print(f'Fixed! Lines: {len(lines)} -> {len(new_lines)}')