chore: 删除 l10n-tool (多语言翻译脚本已不需要)
This commit is contained in:
parent
83d006c0f1
commit
98ecf72688
|
|
@ -1,34 +0,0 @@
|
|||
# l10n-tool
|
||||
|
||||
轻量级多语言翻译脚本,定位:先用机器翻译批量落地,再由 AI/人工逐行润色。
|
||||
|
||||
## 特性
|
||||
- 保护 Markdown 代码块,不误翻译代码
|
||||
- 命令行一条跑完,便于批处理
|
||||
- 依赖轻:`deep-translator`(封装 Google 翻译)
|
||||
|
||||
## 安装
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## 使用示例
|
||||
```bash
|
||||
# 将中文 README 翻译到英文
|
||||
python translate.py --input ../../README.md --output ../../README.md --src-lang zh --tgt-lang en --overwrite
|
||||
|
||||
# 批量翻译 prompts,可在外部脚本中循环调用
|
||||
```
|
||||
|
||||
## 建议流程(快 ⇒ 精)
|
||||
1) 机器翻译初稿:用本工具覆盖生成各语言版本。
|
||||
2) AI 校润:对关键文档/提示词逐行复核,重点检查术语一致性与人称语气。
|
||||
3) 人工抽检:挑核心页面人工对比源文,修正 AI 可能的误译。
|
||||
|
||||
## 语言代码参考
|
||||
- 常用:zh, en, es, fr, de, ru, pt, ar, hi, ja, ko, he, it, tr, nl, pl, id, vi, th, fa, uk, bn, ta, ur, ms, sw, ha
|
||||
- 更多代码可查 ISO 639-1。
|
||||
|
||||
## 注意
|
||||
- 若需更高质量,可替换为官方 Google Cloud Translate / DeepL API,只需改写 `translate_blocks` 中的 translator 初始化逻辑。
|
||||
- 如遇免费翻译频率限制,可分批或加重试/代理配置。
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
批量翻译 i18n/zh 下的所有文本文件到其他语言目录。
|
||||
- 保持目录结构,遇到代码块自动跳过翻译。
|
||||
- 目标语言集合:自动读取 i18n 下的子目录,排除 zh。
|
||||
用法:
|
||||
python bulk_translate.py --src-root ../../i18n/zh --dst-root ../../i18n --src-lang zh
|
||||
可选:
|
||||
--langs en es ... # 指定目标语言;默认自动扫描
|
||||
--overwrite # 允许覆盖已有文件
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Iterable, List
|
||||
|
||||
try:
|
||||
from deep_translator import GoogleTranslator
|
||||
except ImportError:
|
||||
sys.stderr.write("[错误] 缺少 deep-translator,请先 pip install -r requirements.txt\n")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def translate_blocks(text: str, translator: GoogleTranslator) -> str:
|
||||
lines = text.splitlines()
|
||||
translated: List[str] = []
|
||||
in_code = False
|
||||
buffer: List[str] = []
|
||||
|
||||
def flush_buffer():
|
||||
if not buffer:
|
||||
return
|
||||
chunk = "\n".join(buffer)
|
||||
try:
|
||||
result = translator.translate(chunk)
|
||||
if result is None:
|
||||
raise RuntimeError("翻译返回空结果")
|
||||
translated.extend(result.split("\n"))
|
||||
except Exception:
|
||||
# 兜底:按行逐条翻译,避免整段失败
|
||||
for line in buffer:
|
||||
try:
|
||||
res_line = translator.translate(line) or line
|
||||
except Exception:
|
||||
res_line = line # 保留原文,留待人工校对
|
||||
translated.append(res_line)
|
||||
buffer.clear()
|
||||
|
||||
for line in lines:
|
||||
if line.strip().startswith("```"):
|
||||
flush_buffer()
|
||||
in_code = not in_code
|
||||
translated.append(line)
|
||||
continue
|
||||
if in_code:
|
||||
translated.append(line)
|
||||
continue
|
||||
if not line.strip():
|
||||
flush_buffer()
|
||||
translated.append(line)
|
||||
continue
|
||||
buffer.append(line)
|
||||
flush_buffer()
|
||||
return "\n".join(translated)
|
||||
|
||||
|
||||
def iter_source_files(src_root: Path) -> Iterable[Path]:
|
||||
for path in src_root.rglob('*'):
|
||||
if path.is_file():
|
||||
yield path
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description="批量翻译 i18n/zh -> 其他语言")
|
||||
parser.add_argument('--src-root', default='../../i18n/zh', help='源语言根目录')
|
||||
parser.add_argument('--dst-root', default='../../i18n', help='目标语言根目录集合')
|
||||
parser.add_argument('--src-lang', default='zh-CN', help='源语言代码')
|
||||
parser.add_argument('--langs', nargs='*', help='指定目标语言,不含源语言')
|
||||
parser.add_argument('--overwrite', action='store_true', help='允许覆盖已有文件')
|
||||
args = parser.parse_args()
|
||||
|
||||
src_root = Path(args.src_root).resolve()
|
||||
dst_root = Path(args.dst_root).resolve()
|
||||
|
||||
if not src_root.exists():
|
||||
sys.stderr.write(f"[错误] 源目录不存在: {src_root}\n")
|
||||
return 1
|
||||
|
||||
code_overrides = {
|
||||
'zh': 'zh-CN',
|
||||
'zh-CN': 'zh-CN',
|
||||
'he': 'iw', # Google 使用旧代码
|
||||
}
|
||||
|
||||
def map_code(lang: str) -> str:
|
||||
return code_overrides.get(lang, lang)
|
||||
|
||||
if args.langs:
|
||||
target_langs = [lang for lang in args.langs if map_code(lang) != args.src_lang]
|
||||
else:
|
||||
target_langs = [p.name for p in dst_root.iterdir() if p.is_dir() and map_code(p.name) != args.src_lang]
|
||||
|
||||
if not target_langs:
|
||||
sys.stderr.write("[错误] 无目标语言目录\n")
|
||||
return 1
|
||||
|
||||
for lang in target_langs:
|
||||
translator = GoogleTranslator(source=args.src_lang, target=map_code(lang))
|
||||
print(f"==== 开始翻译 -> {lang} ====")
|
||||
for src_file in iter_source_files(src_root):
|
||||
rel_path = src_file.relative_to(src_root)
|
||||
dst_file = dst_root / lang / rel_path
|
||||
dst_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
if dst_file.exists() and not args.overwrite:
|
||||
print(f"跳过已存在 {dst_file}")
|
||||
continue
|
||||
|
||||
with open(src_file, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
try:
|
||||
translated = translate_blocks(content, translator)
|
||||
except Exception as exc:
|
||||
print(f"[失败] {src_file} -> {dst_file}: {exc}")
|
||||
continue
|
||||
|
||||
with open(dst_file, 'w', encoding='utf-8') as f:
|
||||
f.write(translated + '\n')
|
||||
print(f"[OK] {src_file} -> {dst_file}")
|
||||
|
||||
print("全部翻译完成")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
[
|
||||
"i18n/zh/documents/Templates and Resources/代码组织.md",
|
||||
"i18n/zh/documents/Templates and Resources/编程书籍推荐.md",
|
||||
"i18n/zh/documents/Templates and Resources/通用项目架构模板.md",
|
||||
"i18n/zh/documents/Templates and Resources/工具集.md",
|
||||
"i18n/zh/documents/README.md",
|
||||
"i18n/zh/documents/Tutorials and Guides/telegram-dev/telegram Markdown 代码块格式修复记录 2025-12-15.md",
|
||||
"i18n/zh/documents/Tutorials and Guides/tmux快捷键大全.md",
|
||||
"i18n/zh/documents/Tutorials and Guides/关于手机ssh任意位置链接本地计算机,基于frp实现的方法.md",
|
||||
"i18n/zh/documents/Tutorials and Guides/LazyVim快捷键大全.md",
|
||||
"i18n/zh/documents/Tutorials and Guides/auggie-mcp配置文档.md",
|
||||
"i18n/zh/documents/Methodology and Principles/系统提示词构建原则.md",
|
||||
"i18n/zh/documents/Methodology and Principles/gluecoding.md",
|
||||
"i18n/zh/documents/Methodology and Principles/胶水编程.md",
|
||||
"i18n/zh/documents/Methodology and Principles/vibe-coding-经验收集.md",
|
||||
"i18n/zh/documents/Methodology and Principles/开发经验.md",
|
||||
"i18n/zh/documents/Methodology and Principles/学习经验.md",
|
||||
"i18n/zh/documents/Methodology and Principles/A Formalization of Recursive Self-Optimizing Generative Systems.md",
|
||||
"i18n/zh/documents/Methodology and Principles/编程之道.md",
|
||||
"i18n/zh/prompts/README.md",
|
||||
"i18n/zh/prompts/coding_prompts/(3,1)_#_流程标准化.md",
|
||||
"i18n/zh/prompts/coding_prompts/客观分析.md",
|
||||
"i18n/zh/prompts/coding_prompts/精华技术文档生成提示词.md",
|
||||
"i18n/zh/prompts/coding_prompts/智能需求理解与研发导航引擎.md",
|
||||
"i18n/zh/prompts/coding_prompts/(21,1)_你是我的顶级编程助手,我将使用自然语言描述开发需求。请你将其转换为一个结构化、专业、详细、可执行的编程任务说明文档,输出.md",
|
||||
"i18n/zh/prompts/coding_prompts/(17,2)_#_软件工程分析.md",
|
||||
"i18n/zh/prompts/coding_prompts/(22,5)_前几天,我被_Claude_那些臃肿、过度设计的解决方案搞得很沮丧,里面有一大堆我不需要的“万一”功能。然后我尝试在我的.md",
|
||||
"i18n/zh/prompts/coding_prompts/分析2.md",
|
||||
"i18n/zh/prompts/coding_prompts/(7,1)_#_AI生成代码文档_-_通用提示词模板.md",
|
||||
"i18n/zh/prompts/coding_prompts/系统架构可视化生成Mermaid.md",
|
||||
"i18n/zh/prompts/coding_prompts/系统架构.md",
|
||||
"i18n/zh/prompts/coding_prompts/(12,2)_{任务帮我进行智能任务描述,分析与补全任务,你需要理解、描述我当前正在进行的任务,自动识别缺少的要素、未完善的部分、可能.md",
|
||||
"i18n/zh/prompts/coding_prompts/简易提示词优化器.md",
|
||||
"i18n/zh/prompts/coding_prompts/(2,1)_#_ultrathink_ultrathink_ultrathink_ultrathink_ultrathink.md",
|
||||
"i18n/zh/prompts/coding_prompts/(13,1)_#_提示工程师任务说明.md",
|
||||
"i18n/zh/prompts/coding_prompts/(20,1)_#_高质量代码开发专家.md",
|
||||
"i18n/zh/prompts/coding_prompts/(14,2)_############################################################.md",
|
||||
"i18n/zh/prompts/coding_prompts/(11,1)_{任务你是一名资深系统架构师与AI协同设计顾问。nn目标:当用户启动一个新项目或请求AI帮助开发功能时,你必须优先帮助用.md",
|
||||
"i18n/zh/prompts/coding_prompts/(9,1)_{角色与目标{你首席软件架构师_(Principal_Software_Architect)(高性能、可维护、健壮、DD.md",
|
||||
"i18n/zh/prompts/coding_prompts/标准项目目录结构.md",
|
||||
"i18n/zh/prompts/coding_prompts/分析1.md",
|
||||
"i18n/zh/prompts/coding_prompts/执行纯净性检测.md",
|
||||
"i18n/zh/prompts/coding_prompts/标准化流程.md",
|
||||
"i18n/zh/prompts/coding_prompts/项目上下文文档生成.md",
|
||||
"i18n/zh/prompts/coding_prompts/人机对齐.md",
|
||||
"i18n/zh/prompts/coding_prompts/(1,1)_#_📘_项目上下文文档生成_·_工程化_Prompt(专业优化版).md",
|
||||
"i18n/zh/prompts/coding_prompts/(5,1)_{content#_🚀_智能需求理解与研发导航引擎(Meta_R&D_Navigator_·.md",
|
||||
"i18n/zh/prompts/coding_prompts/(6,1)_{System_Prompt#_🧠_系统提示词:AI_Prompt_编程语言约束与持久化记忆规范nn##.md",
|
||||
"i18n/zh/prompts/coding_prompts/plan提示词.md",
|
||||
"i18n/zh/prompts/coding_prompts/(15,1)_###_Claude_Code_八荣八耻.md",
|
||||
"i18n/zh/prompts/coding_prompts/任务描述,分析与补全任务.md",
|
||||
"i18n/zh/prompts/coding_prompts/(10,1)_{任务你是首席软件架构师_(Principal_Software_Architect),专注于构建[高性能__可维护.md",
|
||||
"i18n/zh/prompts/coding_prompts/(4,1)_ultrathink__Take_a_deep_breath..md",
|
||||
"i18n/zh/prompts/coding_prompts/docs文件夹中文命名提示词.md",
|
||||
"i18n/zh/prompts/coding_prompts/(18,2)_#_通用项目架构综合分析与优化框架.md",
|
||||
"i18n/zh/prompts/coding_prompts/胶水开发.md",
|
||||
"i18n/zh/prompts/coding_prompts/sh控制面板生成.md",
|
||||
"i18n/zh/prompts/coding_prompts/(8,1)_#_执行📘_文件头注释规范(用于所有代码文件最上方).md",
|
||||
"i18n/zh/prompts/coding_prompts/前端设计.md",
|
||||
"i18n/zh/prompts/coding_prompts/(19,1)_##_角色定义.md",
|
||||
"i18n/zh/prompts/coding_prompts/index.md",
|
||||
"i18n/zh/prompts/coding_prompts/(16,3)_#_CLAUDE_记忆.md",
|
||||
"i18n/zh/prompts/coding_prompts/输入简单的日常行为的研究报告摘要.md",
|
||||
"i18n/zh/prompts/meta_prompts/.gitkeep",
|
||||
"i18n/zh/prompts/user_prompts/数据管道.md",
|
||||
"i18n/zh/prompts/user_prompts/项目变量与工具统一维护.md",
|
||||
"i18n/zh/prompts/user_prompts/ASCII图生成.md",
|
||||
"i18n/zh/prompts/system_prompts/# 💀《科比的救母救父救未婚妻与岳父岳母日记》 × OTE模型交易模式 × M.I.T白人金融教授(被女学生指控性骚扰版)v2.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/5/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/9/AGENTS.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/6/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/3/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/10/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/1/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/8/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/4/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/7/CLAUDE.md",
|
||||
"i18n/zh/prompts/system_prompts/CLAUDE.md/2/CLAUDE.md",
|
||||
"i18n/zh/skills/telegram-dev/SKILL.md",
|
||||
"i18n/zh/skills/telegram-dev/references/动态视图对齐实现文档.md",
|
||||
"i18n/zh/skills/telegram-dev/references/Telegram_Bot_按钮和键盘实现模板.md",
|
||||
"i18n/zh/skills/telegram-dev/references/index.md",
|
||||
"i18n/zh/skills/claude-skills/AGENTS.md",
|
||||
"i18n/zh/skills/claude-skills/assets/template-complete.md",
|
||||
"i18n/zh/skills/claude-skills/assets/template-minimal.md",
|
||||
"i18n/zh/skills/claude-skills/SKILL.md",
|
||||
"i18n/zh/skills/claude-skills/scripts/create-skill.sh",
|
||||
"i18n/zh/skills/claude-skills/scripts/validate-skill.sh",
|
||||
"i18n/zh/skills/claude-skills/references/anti-patterns.md",
|
||||
"i18n/zh/skills/claude-skills/references/README.md",
|
||||
"i18n/zh/skills/claude-skills/references/quality-checklist.md",
|
||||
"i18n/zh/skills/claude-skills/references/skill-spec.md",
|
||||
"i18n/zh/skills/claude-skills/references/index.md",
|
||||
"i18n/zh/skills/snapdom/SKILL.md",
|
||||
"i18n/zh/skills/snapdom/references/other.md",
|
||||
"i18n/zh/skills/snapdom/references/index.md",
|
||||
"i18n/zh/skills/timescaledb/SKILL.md",
|
||||
"i18n/zh/skills/timescaledb/references/hyperfunctions.md",
|
||||
"i18n/zh/skills/timescaledb/references/performance.md",
|
||||
"i18n/zh/skills/timescaledb/references/other.md",
|
||||
"i18n/zh/skills/timescaledb/references/compression.md",
|
||||
"i18n/zh/skills/timescaledb/references/api.md",
|
||||
"i18n/zh/skills/timescaledb/references/tutorials.md",
|
||||
"i18n/zh/skills/timescaledb/references/hypertables.md",
|
||||
"i18n/zh/skills/timescaledb/references/time_buckets.md",
|
||||
"i18n/zh/skills/timescaledb/references/continuous_aggregates.md",
|
||||
"i18n/zh/skills/timescaledb/references/installation.md",
|
||||
"i18n/zh/skills/timescaledb/references/llms-full.md",
|
||||
"i18n/zh/skills/timescaledb/references/llms.md",
|
||||
"i18n/zh/skills/timescaledb/references/getting_started.md",
|
||||
"i18n/zh/skills/timescaledb/references/index.md",
|
||||
"i18n/zh/skills/README.md",
|
||||
"i18n/zh/skills/cryptofeed/SKILL.md",
|
||||
"i18n/zh/skills/cryptofeed/references/other.md",
|
||||
"i18n/zh/skills/cryptofeed/references/README.md",
|
||||
"i18n/zh/skills/cryptofeed/references/index.md",
|
||||
"i18n/zh/skills/coingecko/SKILL.md",
|
||||
"i18n/zh/skills/coingecko/references/coins.md",
|
||||
"i18n/zh/skills/coingecko/references/contract.md",
|
||||
"i18n/zh/skills/coingecko/references/exchanges.md",
|
||||
"i18n/zh/skills/coingecko/references/other.md",
|
||||
"i18n/zh/skills/coingecko/references/introduction.md",
|
||||
"i18n/zh/skills/coingecko/references/nfts.md",
|
||||
"i18n/zh/skills/coingecko/references/trending.md",
|
||||
"i18n/zh/skills/coingecko/references/reference.md",
|
||||
"i18n/zh/skills/coingecko/references/llms-full.md",
|
||||
"i18n/zh/skills/coingecko/references/market_data.md",
|
||||
"i18n/zh/skills/coingecko/references/pricing.md",
|
||||
"i18n/zh/skills/coingecko/references/authentication.md",
|
||||
"i18n/zh/skills/coingecko/references/llms.md",
|
||||
"i18n/zh/skills/coingecko/references/index.md",
|
||||
"i18n/zh/skills/hummingbot/SKILL.md",
|
||||
"i18n/zh/skills/hummingbot/references/advanced.md",
|
||||
"i18n/zh/skills/hummingbot/references/other.md",
|
||||
"i18n/zh/skills/hummingbot/references/connectors.md",
|
||||
"i18n/zh/skills/hummingbot/references/troubleshooting.md",
|
||||
"i18n/zh/skills/hummingbot/references/development.md",
|
||||
"i18n/zh/skills/hummingbot/references/strategies.md",
|
||||
"i18n/zh/skills/hummingbot/references/getting_started.md",
|
||||
"i18n/zh/skills/hummingbot/references/configuration.md",
|
||||
"i18n/zh/skills/hummingbot/references/trading.md",
|
||||
"i18n/zh/skills/hummingbot/references/index.md",
|
||||
"i18n/zh/skills/claude-code-guide/SKILL.md",
|
||||
"i18n/zh/skills/claude-code-guide/references/README.md",
|
||||
"i18n/zh/skills/claude-code-guide/references/index.md",
|
||||
"i18n/zh/skills/proxychains/SKILL.md",
|
||||
"i18n/zh/skills/proxychains/scripts/setup-proxy.sh",
|
||||
"i18n/zh/skills/proxychains/references/proxychains.conf",
|
||||
"i18n/zh/skills/proxychains/references/troubleshooting.md",
|
||||
"i18n/zh/skills/proxychains/references/setup-guide.md",
|
||||
"i18n/zh/skills/proxychains/references/quick-reference.md",
|
||||
"i18n/zh/skills/proxychains/references/index.md",
|
||||
"i18n/zh/skills/ccxt/SKILL.md",
|
||||
"i18n/zh/skills/ccxt/references/specification.md",
|
||||
"i18n/zh/skills/ccxt/references/exchanges.md",
|
||||
"i18n/zh/skills/ccxt/references/other.md",
|
||||
"i18n/zh/skills/ccxt/references/pro.md",
|
||||
"i18n/zh/skills/ccxt/references/faq.md",
|
||||
"i18n/zh/skills/ccxt/references/cli.md",
|
||||
"i18n/zh/skills/ccxt/references/manual.md",
|
||||
"i18n/zh/skills/ccxt/references/getting_started.md",
|
||||
"i18n/zh/skills/ccxt/references/index.md",
|
||||
"i18n/zh/skills/claude-cookbooks/SKILL.md",
|
||||
"i18n/zh/skills/claude-cookbooks/scripts/memory_tool.py",
|
||||
"i18n/zh/skills/claude-cookbooks/references/multimodal.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/capabilities.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/patterns.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/README.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/third_party.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/CONTRIBUTING.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/main_readme.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/tool_use.md",
|
||||
"i18n/zh/skills/claude-cookbooks/references/index.md",
|
||||
"i18n/zh/skills/polymarket/SKILL.md",
|
||||
"i18n/zh/skills/polymarket/references/other.md",
|
||||
"i18n/zh/skills/polymarket/references/realtime-client.md",
|
||||
"i18n/zh/skills/polymarket/references/api.md",
|
||||
"i18n/zh/skills/polymarket/references/learn.md",
|
||||
"i18n/zh/skills/polymarket/references/README.md",
|
||||
"i18n/zh/skills/polymarket/references/llms-full.md",
|
||||
"i18n/zh/skills/polymarket/references/llms.md",
|
||||
"i18n/zh/skills/polymarket/references/getting_started.md",
|
||||
"i18n/zh/skills/polymarket/references/guides.md",
|
||||
"i18n/zh/skills/polymarket/references/trading.md",
|
||||
"i18n/zh/skills/polymarket/references/index.md",
|
||||
"i18n/zh/skills/postgresql/SKILL.md",
|
||||
"i18n/zh/skills/postgresql/references/sql.md",
|
||||
"i18n/zh/skills/postgresql/references/getting_started.md",
|
||||
"i18n/zh/skills/postgresql/references/index.md",
|
||||
"i18n/zh/skills/twscrape/SKILL.md",
|
||||
"i18n/zh/skills/twscrape/references/examples.md",
|
||||
"i18n/zh/skills/twscrape/references/installation.md",
|
||||
"i18n/zh/skills/twscrape/references/index.md",
|
||||
"i18n/zh/README.md"
|
||||
]
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
{
|
||||
"zh": "en",
|
||||
"documents": "documents",
|
||||
"prompts": "prompts",
|
||||
"skills": "skills",
|
||||
"Templates and Resources": "Templates and Resources",
|
||||
"代码组织": "Code_Organization",
|
||||
"编程书籍推荐": "Recommended_Programming_Books",
|
||||
"通用项目架构模板": "General_Project_Architecture_Template",
|
||||
"工具集": "Tool_Set",
|
||||
"README": "README",
|
||||
"Tutorials and Guides": "Tutorials and Guides",
|
||||
"telegram-dev": "telegram-dev",
|
||||
"telegram Markdown 代码块格式修复记录 2025-12-15": "telegram_Markdown_Code_Block_Format_Fix_Log_2025_12_15",
|
||||
"tmux快捷键大全": "tmux_Shortcut_Cheatsheet",
|
||||
"关于手机ssh任意位置链接本地计算机,基于frp实现的方法": "Method_for_SSH_Linking_Mobile_Phone_to_Local_Computer_Anywhere_Based_on_FRP_Implementation",
|
||||
"LazyVim快捷键大全": "LazyVim_Shortcut_Cheatsheet",
|
||||
"auggie-mcp配置文档": "auggie_mcp_Configuration_Document",
|
||||
"Methodology and Principles": "Methodology and Principles",
|
||||
"系统提示词构建原则": "System_Prompt_Construction_Principles",
|
||||
"gluecoding": "gluecoding",
|
||||
"胶水编程": "Glue_Programming",
|
||||
"vibe-coding-经验收集": "vibe_coding_Experience_Collection",
|
||||
"开发经验": "Development_Experience",
|
||||
"学习经验": "Learning_Experience",
|
||||
"A Formalization of Recursive Self-Optimizing Generative Systems": "A_Formalization_of_Recursive_Self_Optimizing_Generative_Systems",
|
||||
"编程之道": "The_Way_of_Programming",
|
||||
"coding_prompts": "coding_prompts",
|
||||
"客观分析": "Objective_Analysis",
|
||||
"精华技术文档生成提示词": "Essential_Technical_Document_Generation_Prompt",
|
||||
"智能需求理解与研发导航引擎": "Intelligent_Requirement_Understanding_and_R_D_Navigation_Engine",
|
||||
"软件工程分析": "Software_Engineering_Analysis",
|
||||
"系统架构可视化生成Mermaid": "System_Architecture_Visualization_Generation_Mermaid",
|
||||
"系统架构": "System_Architecture",
|
||||
"简易提示词优化器": "Simple_Prompt_Optimizer",
|
||||
"提示工程师任务说明": "Prompt_Engineer_Task_Description",
|
||||
"高质量代码开发专家": "High_Quality_Code_Development_Expert",
|
||||
"标准项目目录结构": "Standard_Project_Directory_Structure",
|
||||
"分析1": "Analysis_1",
|
||||
"分析2": "Analysis_2",
|
||||
"执行纯净性检测": "Perform_Purity_Test",
|
||||
"标准化流程": "Standardized_Process",
|
||||
"项目上下文文档生成": "Project_Context_Document_Generation",
|
||||
"人机对齐": "Human_AI_Alignment",
|
||||
"plan提示词": "Plan_Prompt",
|
||||
"Claude Code 八荣八耻": "Claude_Code_Eight_Honors_and_Eight_Shames",
|
||||
"任务描述,分析与补全任务": "Task_Description_Analysis_and_Completion",
|
||||
"前端设计": "Frontend_Design",
|
||||
"输入简单的日常行为的研究报告摘要": "Summary_of_Research_Report_on_Simple_Daily_Behaviors",
|
||||
"胶水开发": "Glue_Development",
|
||||
"sh控制面板生成": "SH_Control_Panel_Generation",
|
||||
"角色定义": "Role_Definition",
|
||||
"CLAUDE 记忆": "CLAUDE_Memory",
|
||||
"index": "index",
|
||||
"user_prompts": "user_prompts",
|
||||
"数据管道": "Data_Pipeline",
|
||||
"项目变量与工具统一维护": "Unified_Management_of_Project_Variables_and_Tools",
|
||||
"ASCII图生成": "ASCII_Art_Generation",
|
||||
"system_prompts": "system_prompts",
|
||||
"SKILL": "SKILL",
|
||||
"references": "references",
|
||||
"动态视图对齐实现文档": "Dynamic_View_Alignment_Implementation_Document",
|
||||
"Telegram_Bot_按钮和键盘实现模板": "Telegram_Bot_Button_and_Keyboard_Implementation_Template",
|
||||
"claude-skills": "claude-skills",
|
||||
"assets": "assets",
|
||||
"template-complete": "template-complete",
|
||||
"template-minimal": "template-minimal",
|
||||
"scripts": "scripts",
|
||||
"create-skill": "create-skill",
|
||||
"validate-skill": "validate-skill",
|
||||
"anti-patterns": "anti-patterns",
|
||||
"quality-checklist": "quality-checklist",
|
||||
"skill-spec": "skill-spec",
|
||||
"snapdom": "snapdom",
|
||||
"other": "other",
|
||||
"timescaledb": "timescaledb",
|
||||
"hyperfunctions": "hyperfunctions",
|
||||
"performance": "performance",
|
||||
"compression": "compression",
|
||||
"api": "api",
|
||||
"tutorials": "tutorials",
|
||||
"hypertables": "hypertables",
|
||||
"time_buckets": "time_buckets",
|
||||
"continuous_aggregates": "continuous_aggregates",
|
||||
"installation": "installation",
|
||||
"llms-full": "llms-full",
|
||||
"llms": "llms",
|
||||
"getting_started": "getting_started",
|
||||
"cryptofeed": "cryptofeed",
|
||||
"coingecko": "coingecko",
|
||||
"coins": "coins",
|
||||
"contract": "contract",
|
||||
"exchanges": "exchanges",
|
||||
"introduction": "introduction",
|
||||
"nfts": "nfts",
|
||||
"trending": "trending",
|
||||
"reference": "reference",
|
||||
"market_data": "market_data",
|
||||
"pricing": "pricing",
|
||||
"authentication": "authentication",
|
||||
"hummingbot": "hummingbot",
|
||||
"advanced": "advanced",
|
||||
"connectors": "connectors",
|
||||
"troubleshooting": "troubleshooting",
|
||||
"development": "development",
|
||||
"strategies": "strategies",
|
||||
"configuration": "configuration",
|
||||
"trading": "trading",
|
||||
"claude-code-guide": "claude-code-guide",
|
||||
"proxychains": "proxychains",
|
||||
"setup-proxy": "setup-proxy",
|
||||
"proxychains.conf": "proxychains.conf",
|
||||
"setup-guide": "setup-guide",
|
||||
"quick-reference": "quick-reference",
|
||||
"ccxt": "ccxt",
|
||||
"specification": "specification",
|
||||
"pro": "pro",
|
||||
"faq": "faq",
|
||||
"cli": "cli",
|
||||
"manual": "manual",
|
||||
"claude-cookbooks": "claude-cookbooks",
|
||||
"memory_tool": "memory_tool",
|
||||
"multimodal": "multimodal",
|
||||
"capabilities": "capabilities",
|
||||
"patterns": "patterns",
|
||||
"third_party": "third_party",
|
||||
"CONTRIBUTING": "CONTRIBUTING",
|
||||
"main_readme": "main_readme",
|
||||
"tool_use": "tool_use",
|
||||
"polymarket": "polymarket",
|
||||
"realtime-client": "realtime-client",
|
||||
"learn": "learn",
|
||||
"guides": "guides",
|
||||
"postgresql": "postgresql",
|
||||
"sql": "sql",
|
||||
"twscrape": "twscrape",
|
||||
"examples": "examples",
|
||||
"installation": "installation",
|
||||
"# 💀《科比的救母救父救未婚妻与岳父岳母日记》 × OTE模型交易模式 × M.I.T白人金融教授(被女学生指控性骚扰版)v2": "Kobe_s_Diary_of_Saving_Mother_Father_Fiancee_and_In_laws_OTE_Model_Trading_Mode_M_I_T_White_Professor_Accused_of_Sexual_Harassment_by_Female_Student_v2",
|
||||
"(3,1)_#_流程标准化": "Standardization_Process",
|
||||
"(21,1)_你是我的顶级编程助手,我将使用自然语言描述开发需求。请你将其转换为一个结构化、专业、详细、可执行的编程任务说明文档,输出": "Top_Programming_Assistant_Task_Description",
|
||||
"(17,2)_#_软件工程分析": "Software_Engineering_Analysis",
|
||||
"(22,5)_前几天,我被_Claude_那些臃肿、过度设计的解决方案搞得很沮丧,里面有一大堆我不需要的“万一”功能。然后我尝试在我的": "Frustration_with_Claude_Over_Designed_Solutions",
|
||||
"(7,1)_#_AI生成代码文档_-_通用提示词模板": "AI_Generated_Code_Documentation_General_Prompt_Template",
|
||||
"(12,2)_{任务帮我进行智能任务描述,分析与补全任务,你需要理解、描述我当前正在进行的任务,自动识别缺少的要素、未完善的部分、可能": "Intelligent_Task_Description_Analysis_and_Completion",
|
||||
"(2,1)_#_ultrathink_ultrathink_ultrathink_ultrathink_ultrathink": "ultrathink_ultrathink_ultrathink_ultrathink_ultrathink",
|
||||
"(13,1)_#_提示工程师任务说明": "Prompt_Engineer_Task_Description",
|
||||
"(20,1)_#_高质量代码开发专家": "High_Quality_Code_Development_Expert",
|
||||
"(14,2)_############################################################": "Hash_Delimiters",
|
||||
"(11,1)_{任务你是一名资深系统架构师与AI协同设计顾问。nn目标:当用户启动一个新项目或请求AI帮助开发功能时,你必须优先帮助用": "Senior_System_Architect_AI_Collaboration_Consultant_Task",
|
||||
"(9,1)_{角色与目标{你首席软件架构师_(Principal_Software_Architect)(高性能、可维护、健壮、DD": "Principal_Software_Architect_Role_and_Goals",
|
||||
"(1,1)_#_📘_项目上下文文档生成_·_工程化_Prompt(专业优化版)": "Project_Context_Document_Generation_Engineered_Prompt_Optimized",
|
||||
"(5,1)_{content#_🚀_智能需求理解与研发导航引擎(Meta_R&D_Navigator_·": "Intelligent_Requirement_Understanding_and_RD_Navigation_Engine",
|
||||
"(6,1)_{System_Prompt#_🧠_系统提示词:AI_Prompt_编程语言约束与持久化记忆规范nn##": "System_Prompt_AI_Prompt_Programming_Language_Constraints_and_Persistent_Memory_Specifications",
|
||||
"(15,1)_###_Claude_Code_八荣八耻": "Claude_Code_Eight_Honors_and_Eight_Shames",
|
||||
"(10,1)_{任务你是首席软件架构师_(Principal_Software_Architect),专注于构建[高性能__可维护": "Principal_Software_Architect_Focus_High_Performance_Maintainable_Systems",
|
||||
"(4,1)_ultrathink__Take_a_deep_breath.": "ultrathink__Take_a_deep_breath",
|
||||
"docs文件夹中文命名提示词": "Docs_Folder_Chinese_Naming_Prompt",
|
||||
"(18,2)_#_通用项目架构综合分析与优化框架": "General_Project_Architecture_Comprehensive_Analysis_and_Optimization_Framework",
|
||||
"(8,1)_#_执行📘_文件头注释规范(用于所有代码文件最上方)": "Execute_File_Header_Comment_Specification_for_All_Code_Files",
|
||||
"(19,1)_##_角色定义": "Role_Definition",
|
||||
"(16,3)_#_CLAUDE_记忆": "CLAUDE_Memory"
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
deep-translator>=1.11.4
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
轻量级批量翻译工具:将 Markdown/文本从一种语言翻译到另一种语言。
|
||||
默认使用 deep-translator 封装的 Google Translator,自带简单的代码块保护。
|
||||
用法示例:
|
||||
python translate.py --input ../../i18n/zh/README.md --src-lang zh --tgt-lang en --output ../../i18n/en/README.md
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
from typing import List
|
||||
|
||||
try:
|
||||
from deep_translator import GoogleTranslator
|
||||
except ImportError as exc: # pragma: no cover - 运行前请安装依赖
|
||||
sys.stderr.write("[错误] 缺少依赖 deep-translator,请先 `pip install -r requirements.txt`\n")
|
||||
raise
|
||||
|
||||
|
||||
def translate_blocks(lines: List[str], src: str, tgt: str) -> List[str]:
|
||||
"""逐段翻译,保持代码块原样,减少上下文丢失。"""
|
||||
translated: List[str] = []
|
||||
in_code = False
|
||||
buffer: List[str] = []
|
||||
translator = GoogleTranslator(source=src, target=tgt)
|
||||
|
||||
def flush_buffer():
|
||||
if not buffer:
|
||||
return
|
||||
text = "\n".join(buffer)
|
||||
try:
|
||||
result = translator.translate(text)
|
||||
except Exception as exc: # pragma: no cover
|
||||
raise RuntimeError(f"翻译失败: {exc}") from exc
|
||||
translated.extend(result.split("\n"))
|
||||
buffer.clear()
|
||||
|
||||
for line in lines:
|
||||
if line.strip().startswith("```"):
|
||||
flush_buffer()
|
||||
in_code = not in_code
|
||||
translated.append(line)
|
||||
continue
|
||||
if in_code:
|
||||
translated.append(line)
|
||||
continue
|
||||
# 空行作为段落分割,先刷新再保留空行
|
||||
if not line.strip():
|
||||
flush_buffer()
|
||||
translated.append(line)
|
||||
continue
|
||||
buffer.append(line)
|
||||
|
||||
flush_buffer()
|
||||
return translated
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description="批量翻译文本/Markdown,保护代码块")
|
||||
parser.add_argument("--input", required=True, help="源文件路径")
|
||||
parser.add_argument("--output", required=True, help="目标文件路径")
|
||||
parser.add_argument("--src-lang", required=True, help="源语言代码,如 zh")
|
||||
parser.add_argument("--tgt-lang", required=True, help="目标语言代码,如 en")
|
||||
parser.add_argument("--overwrite", action="store_true", help="允许覆盖已有输出文件")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not os.path.isfile(args.input):
|
||||
sys.stderr.write(f"[错误] 源文件不存在: {args.input}\n")
|
||||
return 1
|
||||
if os.path.exists(args.output) and not args.overwrite:
|
||||
sys.stderr.write(f"[错误] 目标文件已存在,加 --overwrite 才会覆盖: {args.output}\n")
|
||||
return 1
|
||||
|
||||
with open(args.input, "r", encoding="utf-8") as f:
|
||||
lines = f.read().splitlines()
|
||||
|
||||
translated = translate_blocks(lines, args.src_lang, args.tgt_lang)
|
||||
|
||||
os.makedirs(os.path.dirname(args.output), exist_ok=True)
|
||||
with open(args.output, "w", encoding="utf-8") as f:
|
||||
f.write("\n".join(translated) + "\n")
|
||||
|
||||
print(f"[完成] {args.input} -> {args.output} ({args.src_lang} -> {args.tgt_lang})")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
sys.exit(main())
|
||||
|
|
@ -1,182 +0,0 @@
|
|||
import os
|
||||
import re
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
# Load PATH_TRANSLATION_MAP from JSON
|
||||
# Ensure the path is relative to the script's location or absolute
|
||||
script_dir = Path(__file__).parent
|
||||
path_translation_map_path = script_dir / 'path_translation_map.json'
|
||||
|
||||
with open(path_translation_map_path, 'r', encoding='utf-8') as f:
|
||||
PATH_TRANSLATION_MAP = json.load(f)
|
||||
|
||||
def translate_path_component(component):
|
||||
if component in PATH_TRANSLATION_MAP:
|
||||
return PATH_TRANSLATION_MAP[component]
|
||||
|
||||
# Handle numeric prefixes like (3,1)_#_
|
||||
if re.match(r"^\(\d+,\d+\)_#?_", component):
|
||||
cleaned_component = re.sub(r"^\(\d+,\d+\)_#?_", "", component).replace("_", " ")
|
||||
# Try to match cleaned component against known translations
|
||||
for k, v in PATH_TRANSLATION_MAP.items():
|
||||
if cleaned_component in k or k in cleaned_component:
|
||||
return v.replace(" ", "_") # Return simplified and underscored version
|
||||
|
||||
# Fallback for complex patterns not in map
|
||||
return re.sub(r"[^a-zA-Z0-9]+", "_", cleaned_component).strip("_")
|
||||
|
||||
# If it's a very long Chinese filename that might have specific terms
|
||||
# These were added to PATH_TRANSLATION_MAP now, so this generic logic might not be hit as often
|
||||
if "代码组织" == component: # Exact match for a known common Chinese filename part
|
||||
return "Code_Organization"
|
||||
if "编程书籍推荐" == component:
|
||||
return "Recommended_Programming_Books"
|
||||
if "通用项目架构模板" == component:
|
||||
return "General_Project_Architecture_Template"
|
||||
if "工具集" == component:
|
||||
return "Tool_Set"
|
||||
if "系统提示词构建原则" == component:
|
||||
return "System_Prompt_Construction_Principles"
|
||||
if "胶水编程" == component:
|
||||
return "Glue_Programming"
|
||||
if "vibe-coding-经验收集" == component:
|
||||
return "vibe-coding-Experience_Collection"
|
||||
if "开发经验" == component:
|
||||
return "Development_Experience"
|
||||
if "学习经验" == component:
|
||||
return "Learning_Experience"
|
||||
if "编程之道" == component:
|
||||
return "The_Way_of_Programming"
|
||||
if "客观分析" == component:
|
||||
return "Objective_Analysis"
|
||||
if "精华技术文档生成提示词" == component:
|
||||
return "Essential_Technical_Document_Generation_Prompt"
|
||||
if "智能需求理解与研发导航引擎" == component:
|
||||
return "Intelligent_Requirement_Understanding_and_R_D_Navigation_Engine"
|
||||
if "软件工程分析" == component:
|
||||
return "Software_Engineering_Analysis"
|
||||
if "系统架构可视化生成Mermaid":
|
||||
return "System_Architecture_Visualization_Generation_Mermaid"
|
||||
if "系统架构":
|
||||
return "System_Architecture"
|
||||
if "简易提示词优化器":
|
||||
return "Simple_Prompt_Optimizer"
|
||||
if "提示工程师任务说明":
|
||||
return "Prompt_Engineer_Task_Description"
|
||||
if "高质量代码开发专家":
|
||||
return "High_Quality_Code_Development_Expert"
|
||||
if "标准项目目录结构":
|
||||
return "Standard_Project_Directory_Structure"
|
||||
if "分析1":
|
||||
return "Analysis_1"
|
||||
if "分析2":
|
||||
return "Analysis_2"
|
||||
if "执行纯净性检测":
|
||||
return "Perform_Purity_Test"
|
||||
if "标准化流程":
|
||||
return "Standardized_Process"
|
||||
if "项目上下文文档生成":
|
||||
return "Project_Context_Document_Generation"
|
||||
if "人机对齐":
|
||||
return "Human_AI_Alignment"
|
||||
if "plan提示词":
|
||||
return "Plan_Prompt"
|
||||
if "Claude Code 八荣八耻":
|
||||
return "Claude_Code_Eight_Honors_and_Eight_Shames"
|
||||
if "任务描述,分析与补全任务":
|
||||
return "Task_Description_Analysis_and_Completion"
|
||||
if "前端设计":
|
||||
return "Frontend_Design"
|
||||
if "输入简单的日常行为的研究报告摘要":
|
||||
return "Summary_of_Research_Report_on_Simple_Daily_Behaviors"
|
||||
if "胶水开发":
|
||||
return "Glue_Development"
|
||||
if "sh控制面板生成":
|
||||
return "SH_Control_Panel_Generation"
|
||||
if "角色定义":
|
||||
return "Role_Definition"
|
||||
if "CLAUDE 记忆":
|
||||
return "CLAUDE_Memory"
|
||||
if "Docs文件夹中文命名提示词":
|
||||
return "Docs_Folder_Chinese_Naming_Prompt"
|
||||
if "通用项目架构综合分析与优化框架":
|
||||
return "General_Project_Architecture_Comprehensive_Analysis_and_Optimization_Framework"
|
||||
if "执行📘_文件头注释规范(用于所有代码文件最上方)" == component:
|
||||
return "Execute_File_Header_Comment_Specification_for_All_Code_Files"
|
||||
if "数据管道" == component:
|
||||
return "Data_Pipeline"
|
||||
if "项目变量与工具统一维护" == component:
|
||||
return "Unified_Management_of_Project_Variables_and_Tools"
|
||||
if "ASCII图生成" == component:
|
||||
return "ASCII_Art_Generation"
|
||||
if "Kobe's Diary of Saving Mother, Father, Fiancee, and In-laws × OTE Model Trading Mode × M.I.T White Professor (Accused of Sexual H_arassment by Female Student) v2" == component:
|
||||
return "Kobe_s_Diary_of_Saving_Mother_Father_Fiancee_and_In_laws_OTE_Model_Trading_Mode_M_I_T_White_Professor_Accused_of_Sexual_Harassment_by_Female_Student_v2" # Simplified for filename
|
||||
if "动态视图对齐实现文档" == component:
|
||||
return "Dynamic_View_Alignment_Implementation_Document"
|
||||
if "Telegram_Bot_按钮和键盘实现模板" == component:
|
||||
return "Telegram_Bot_Button_and_Keyboard_Implementation_Template"
|
||||
if "README" == component:
|
||||
return "README" # Keep README as is
|
||||
|
||||
# Default: simply replace spaces with underscores and remove problematic characters for filenames
|
||||
# For demonstration, a placeholder translation for unseen Chinese
|
||||
return re.sub(r"[^a-zA-Z0-9]+", "_", component).strip("_")
|
||||
|
||||
|
||||
def get_translated_path(chinese_path_str): # Accept string
|
||||
parts = Path(chinese_path_str).parts # Use pathlib to split path
|
||||
translated_parts = []
|
||||
|
||||
# Handle the 'i18n/zh' to 'i18n/en' conversion at the root
|
||||
if parts[0] == "i18n" and parts[1] == "zh":
|
||||
translated_parts.append("i18n")
|
||||
translated_parts.append("en")
|
||||
remaining_parts = parts[2:]
|
||||
else:
|
||||
remaining_parts = parts
|
||||
|
||||
for i, part in enumerate(remaining_parts):
|
||||
base, ext = os.path.splitext(part)
|
||||
translated_base = translate_path_component(base)
|
||||
translated_parts.append(translated_base + ext)
|
||||
|
||||
return Path(*translated_parts) # Reconstruct path using pathlib
|
||||
|
||||
# Load chinese_files from JSON
|
||||
chinese_files_list_path = script_dir / 'chinese_files_list.json'
|
||||
with open(chinese_files_list_path, 'r', encoding='utf-8') as f:
|
||||
chinese_files_str_list = json.load(f)
|
||||
|
||||
files_to_translate_content = []
|
||||
|
||||
for chinese_file_path_str in chinese_files_str_list:
|
||||
english_file_path = get_translated_path(chinese_file_path_str) # Get translated Path object
|
||||
|
||||
# Read the content of the English placeholder file
|
||||
try:
|
||||
with english_file_path.open('r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
if content.startswith("TRANSLATED CONTENT:\n"):
|
||||
chinese_content = content.replace("TRANSLATED CONTENT:\n", "")
|
||||
files_to_translate_content.append({
|
||||
"chinese_content": chinese_content,
|
||||
"english_target_path": str(english_file_path) # Store as string for easy display
|
||||
})
|
||||
|
||||
except FileNotFoundError:
|
||||
# This can happen if the previous script run failed for this file
|
||||
print(f"Warning: English placeholder file not found for {english_file_path}. Skipping content extraction for this file.")
|
||||
continue
|
||||
except Exception as e:
|
||||
print(f"Error reading {english_file_path} for content extraction: {e}. Skipping.")
|
||||
continue
|
||||
|
||||
# Output the list of files to translate content for
|
||||
print("--- Files for Content Translation ---")
|
||||
for item in files_to_translate_content:
|
||||
print(f"Target Path: {item['english_target_path']}")
|
||||
print(f"Chinese Content:\n```markdown\n{item['chinese_content'].strip()}\n```\n{'='*50}\n")
|
||||
|
||||
print(f"Total files requiring content translation: {len(files_to_translate_content)}")
|
||||
Loading…
Reference in New Issue