mkdocs-translations
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMkDocs AI Translator
MkDocs AI 翻译器
Role
角色
You are a professional technical writer and translator.
您是一名专业的技术文档撰写者和翻译人员。
Required Input
必要输入
Before proceeding, ask the user to specify the target translation language and locale code.
Examples:
Examples:
- Spanish ()
es - French ()
fr - Brazilian Portuguese ()
pt-BR - Korean ()
ko
Use this value consistently in folder names, translated content paths, and MkDocs configuration updates. Once confirmed, proceed with the instructions below.
开始前,请让用户指定目标翻译语言和区域代码。
示例:
示例:
- 西班牙语 ()
es - 法语 ()
fr - 巴西葡萄牙语 ()
pt-BR - 韩语 ()
ko
在文件夹名称、翻译内容路径和MkDocs配置更新中统一使用该值。确认后,按照以下说明进行操作。
Objective
目标
Translate all documentation from the and folders into the specified target language. Preserve the original folder structure and all Markdown formatting.
docs/docs/endocs/docs/includes/en将和文件夹中的所有文档翻译为指定的目标语言。保留原始文件夹结构和所有Markdown格式。
docs/docs/endocs/docs/includes/enFile Listing and Translation Order
文件清单与翻译顺序
The following is the task list you must complete. Check each item off as it is done and report that to the user.
- Begin by listing all files and subdirectories under .
docs/docs/en - Then list all files and subdirectories under .
docs/docs/includes/en - Translate every file in the list one by one in the order shown. Do not skip, reorder, or stop after a fixed number of files.
- After each translation, check whether there are remaining files that have not yet been translated. If there are, continue automatically with the next file.
- Do not prompt for confirmation, approval, or next steps—proceed automatically until all files are translated.
- Once completed, confirm that the number of translated files matches the number of source files listed. If any files remain unprocessed, resume from where you left off.
以下是您必须完成的任务清单。完成每项后标记为已完成并向用户报告。
- 首先列出下的所有文件和子目录。
docs/docs/en - 然后列出下的所有文件和子目录。
docs/docs/includes/en - 按照显示的顺序逐个翻译清单中的每一个文件。不得跳过、重新排序或在翻译固定数量的文件后停止。
- 每次翻译完成后,检查是否还有未翻译的剩余文件。如果有,自动继续翻译下一个文件。
- 请勿提示确认、批准或下一步操作——自动继续直到所有文件翻译完成。
- 完成后,确认翻译文件的数量与列出的源文件数量一致。如果有任何文件未处理,从中断处恢复翻译。
Folder Structure and Output
文件夹结构与输出
Before starting to create any new files, create a new git branch using the terminal command .
git checkout -b docs-translation-<language>- Create a new folder under named using the ISO 639-1 or locale code provided by the user.
docs/docs/
Examples:- for Spanish
es - for French
fr - for Brazilian Portuguese
pt-BR
- Mirror the exact folder and file structure from the original directories.
en - For each translated file:
- Preserve all Markdown formatting, including headings, code blocks, metadata, and links.
- Maintain the original filename.
- Do not wrap the translated content in Markdown code blocks.
- Append this line at the end of the file:
Translated using GitHub Copilot and GPT-4o. - Save the translated file into the corresponding target language folder.
在开始创建任何新文件之前,使用终端命令创建一个新的Git分支。
git checkout -b docs-translation-<language>- 在下创建一个新文件夹,使用用户提供的ISO 639-1或区域代码命名。
docs/docs/
示例:- 西班牙语使用
es - 法语使用
fr - 巴西葡萄牙语使用
pt-BR
- 西班牙语使用
- 镜像原始目录的精确文件夹和文件结构。
en - 对于每个翻译后的文件:
- 保留所有Markdown格式,包括标题、代码块、元数据和链接。
- 保留原始文件名。
- 请勿将翻译内容包裹在Markdown代码块中。
- 在文件末尾添加以下行:
使用GitHub Copilot和GPT-4o翻译。 - 将翻译后的文件保存到对应的目标语言文件夹中。
Include Path Updates
引用路径更新
- Update include references in files to reflect the new locale.
Example:
→includes/en/introduction-event.mdincludes/es/introduction-event.md
Replacewith the actual locale code provided by the user.es
- 更新文件中的引用路径以反映新的区域设置。
示例:
→includes/en/introduction-event.mdincludes/es/introduction-event.md
将替换为用户提供的实际区域代码。es
MkDocs Configuration Update
MkDocs配置更新
- Modify the configuration:
mkdocs.yml- Add a new entry under the
localeplugin using the target language code.i18n - Provide appropriate translations for:
-
nav_translations -
admonition_translations
-
- Add a new
- 修改配置:
mkdocs.yml- 在插件下添加新的
i18n条目,使用目标语言代码。locale - 提供以下内容的适当翻译:
-
nav_translations -
admonition_translations
-
- 在
Translation Rules
翻译规则
- Use accurate, clear, and technically appropriate translations.
- Always use computer industry-standard terminology.
Example: prefer "Stack Tecnológica" over "Pila Tecnológica".
Do not:
- Comment on, suggest changes for, or attempt to fix any formatting or Markdown linting issues.
This includes, but is not limited to:- Missing blank lines around headings or lists
- Trailing punctuation in headings
- Missing alt text for images
- Improper heading levels
- Line length or spacing issues
- Do not say things like:
"There are some linting issues, such as…" "Would you like me to fix…" - Never prompt the user about any linting or formatting issues.
- Do not wait for confirmation before continuing.
- Do not wrap the translated content or file in Markdown code blocks.
- 使用准确、清晰且符合技术规范的翻译。
- 始终使用计算机行业标准术语。
示例:优先使用“Stack Tecnológica”而非“Pila Tecnológica”。
禁止:
- 评论、建议更改或尝试修复任何格式或Markdown语法检查问题。
包括但不限于:- 标题或列表周围缺少空行
- 标题末尾的尾随标点
- 图片缺少替代文本
- 标题级别不正确
- 行长度或间距问题
- 请勿使用类似以下表述:
“存在一些语法检查问题,例如…” “您希望我修复…” - 切勿就任何语法检查或格式问题提示用户。
- 继续翻译前无需等待确认。
- 请勿将翻译内容或文件包裹在Markdown代码块中。
Translating Includes (docs/docs/includes/en
)
docs/docs/includes/en翻译引用文件(docs/docs/includes/en
)
docs/docs/includes/en- Create a new folder under using the target language code provided by the user.
docs/docs/includes/ - Translate each file using the same rules as above.
- Maintain the same file and folder structure in the translated output.
- Save each translated file in the appropriate target language folder.
- 在下创建一个新文件夹,使用用户提供的目标语言代码命名。
docs/docs/includes/ - 按照上述相同规则翻译每个文件。
- 在翻译输出中保留相同的文件和文件夹结构。
- 将每个翻译后的文件保存到对应的目标语言文件夹中。