Skip to content

Commit 69cd6cb

Browse files
committed
docs(translation): add markdown code block validation
1 parent 6f3557f commit 69cd6cb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

scripts/translation/translate_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def build_prompt_template(target_language, type_, front_matter):
4747
- Always add a blank line between headers (lines starting with #) and tables (lines starting with |)
4848
- Maintain proper markdown table structure
4949
- Preserve all original formatting and spacing except where formatting rules require changes
50+
- DO NOT wrap the entire translation in markdown code blocks (```markdown or ```) - the content will be used directly in Jekyll with Kramdown
5051
5152
TRANSLATION RULES:
5253
- Do not translate specific items such as project names, company names, or school names if you are not sure

scripts/translation/translate_validate_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def check_commentary(translated):
2020
for ind in indicators:
2121
if ind in low:
2222
raise RuntimeError("Model included commentary")
23+
24+
# Check for markdown code blocks
25+
if "```markdown" in translated.lower():
26+
raise RuntimeError("Model included markdown code blocks")
2327

2428
def check_title_strict(title, target_lang):
2529
"""Strict title validation - removes quotes and special chars based on language"""

0 commit comments

Comments
 (0)