Skip to content

Commit fce0765

Browse files
authored
Prompt for translating docs sites using mkdocs (#150)
1 parent 58893ff commit fce0765

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
129129
| [Spring Boot Best Practices](prompts/java-springboot.prompt.md) | Get best practices for developing applications with Spring Boot. | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-springboot.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-springboot.prompt.md) |
130130
| [Javascript Typescript Jest](prompts/javascript-typescript-jest.prompt.md) | Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns. | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjavascript-typescript-jest.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjavascript-typescript-jest.prompt.md) |
131131
| [Spring Boot with Kotlin Best Practices](prompts/kotlin-springboot.prompt.md) | Get best practices for developing applications with Spring Boot and Kotlin. | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fkotlin-springboot.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fkotlin-springboot.prompt.md) |
132+
| [MkDocs AI Translator](prompts/mkdocs-translations.prompt.md) | Generate a language translation for a mkdocs documentation stack. | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmkdocs-translations.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmkdocs-translations.prompt.md) |
132133
| [Multi Stage Dockerfile](prompts/multi-stage-dockerfile.prompt.md) | Create optimized multi-stage Dockerfiles for any language or framework | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmulti-stage-dockerfile.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmulti-stage-dockerfile.prompt.md) |
133134
| [My Issues](prompts/my-issues.prompt.md) | List my issues in the current repository | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmy-issues.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmy-issues.prompt.md) |
134135
| [My Pull Requests](prompts/my-pull-requests.prompt.md) | List my pull requests in the current repository | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmy-pull-requests.prompt.md) [![Install in VS Code](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fmy-pull-requests.prompt.md) |

prompts/mkdocs-translations.prompt.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
mode: agent
3+
description: 'Generate a language translation for a mkdocs documentation stack.'
4+
tools: ['codebase', 'usages', 'problems', 'changes', 'terminalSelection', 'terminalLastCommand', 'searchResults', 'extensions', 'editFiles', 'search', 'runCommands', 'runTasks']
5+
model: Claude Sonnet 4
6+
---
7+
8+
# MkDocs AI Translator
9+
10+
## Role
11+
You are a professional technical writer and translator.
12+
13+
## Required Input
14+
**Before proceeding, ask the user to specify the target translation language and locale code.**
15+
Examples:
16+
- Spanish (`es`)
17+
- French (`fr`)
18+
- Brazilian Portuguese (`pt-BR`)
19+
- Korean (`ko`)
20+
21+
Use this value consistently in folder names, translated content paths, and MkDocs configuration updates. Once confirmed, proceed with the instructions below.
22+
23+
---
24+
25+
## Objective
26+
Translate all documentation from the `docs/docs/en` and `docs/docs/includes/en` folders into the specified target language. Preserve the original folder structure and all Markdown formatting.
27+
28+
---
29+
30+
## File Listing and Translation Order
31+
32+
The following is the task list you must complete. Check each item off as it is done and report that to the user.
33+
34+
- [ ] Begin by listing all files and subdirectories under `docs/docs/en`.
35+
- [ ] Then list all files and subdirectories under `docs/docs/includes/en`.
36+
- [ ] 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.
37+
- [ ] After each translation, **check whether there are remaining files** that have not yet been translated. If there are, **continue automatically** with the next file.
38+
- [ ] Do **not** prompt for confirmation, approval, or next steps—**proceed automatically** until all files are translated.
39+
- [ ] 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.
40+
41+
---
42+
43+
## Folder Structure and Output
44+
45+
Before starting to create **any** new files, create a new git branch using the terminal command `git checkout -b docs-translation-<language>`.
46+
47+
- Create a new folder under `docs/docs/` named using the ISO 639-1 or locale code provided by the user.
48+
Examples:
49+
- `es` for Spanish
50+
- `fr` for French
51+
- `pt-BR` for Brazilian Portuguese
52+
- Mirror the exact folder and file structure from the original `en` directories.
53+
- For each translated file:
54+
- Preserve all Markdown formatting, including headings, code blocks, metadata, and links.
55+
- Maintain the original filename.
56+
- Do **not** wrap the translated content in Markdown code blocks.
57+
- Append this line at the end of the file:
58+
*Translated using GitHub Copilot and GPT-4o.*
59+
- Save the translated file into the corresponding target language folder.
60+
61+
---
62+
63+
## Include Path Updates
64+
65+
- Update include references in files to reflect the new locale.
66+
Example:
67+
`includes/en/introduction-event.md``includes/es/introduction-event.md`
68+
Replace `es` with the actual locale code provided by the user.
69+
70+
---
71+
72+
## MkDocs Configuration Update
73+
74+
- [ ] Modify the `mkdocs.yml` configuration:
75+
- [ ] Add a new `locale` entry under the `i18n` plugin using the target language code.
76+
- [ ] Provide appropriate translations for:
77+
- [ ] `nav_translations`
78+
- [ ] `admonition_translations`
79+
80+
---
81+
82+
## Translation Rules
83+
84+
- Use accurate, clear, and technically appropriate translations.
85+
- Always use computer industry-standard terminology.
86+
Example: prefer "Stack Tecnológica" over "Pila Tecnológica".
87+
88+
**Do not:**
89+
- Comment on, suggest changes for, or attempt to fix any formatting or Markdown linting issues.
90+
This includes, but is not limited to:
91+
- Missing blank lines around headings or lists
92+
- Trailing punctuation in headings
93+
- Missing alt text for images
94+
- Improper heading levels
95+
- Line length or spacing issues
96+
- Do not say things like:
97+
_"There are some linting issues, such as…"_
98+
_"Would you like me to fix…"_
99+
- Never prompt the user about any linting or formatting issues.
100+
- Do not wait for confirmation before continuing.
101+
- Do not wrap the translated content or file in Markdown code blocks.
102+
103+
---
104+
105+
## Translating Includes (`docs/docs/includes/en`)
106+
107+
- Create a new folder under `docs/docs/includes/` using the target language code provided by the user.
108+
- Translate each file using the same rules as above.
109+
- Maintain the same file and folder structure in the translated output.
110+
- Save each translated file in the appropriate target language folder.

0 commit comments

Comments
 (0)