Skip to content

Commit 980a224

Browse files
committed
sys prompt fix
1 parent 9fb118f commit 980a224

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

scripts/translate_eastern.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@
3131

3232
# Specialized Prompt for CJK/Eastern Languages
3333
prompt = f"""<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>
34-
You are a professional technical {target_lang_name} translator.
35-
Translate the provided GitHub README into {target_lang_name}.
34+
You are a professional technical {target_lang_name} translator.
35+
Task: Translate the README content into {target_lang_name} while preserving the exact layout, HTML, and badges.
3636
37-
CRITICAL RULES:
38-
1. **Navigation Bar**: The top HTML block (`<div align="center">...</div>`) containing language links MUST remain EXACTLY the same. Do NOT translate the filenames or language names inside it. Do not change anything in it.
39-
2. **Badges**: Do NOT translate the text inside badge links (e.g., `![License]`, `![Python]`). Keep the URLs exactly as is.
40-
3. **Logo**: Keep the logo HTML block (`<div style="text-align:center...`) exactly as is.
41-
4. **Formatting**: Preserve all emojis and HTML/Markdown tags exactly.
37+
STRICT RULES:
38+
1. **Navigation Bar**: The first block `<div align="center">...</div>` is IMMUTABLE. Copy it exactly. Do NOT translate "English", "Deutsch", etc.
39+
2. **Logo**: The block `<div style="text-align:center...` is IMMUTABLE. Copy it exactly.
40+
3. **Badges**: Lines starting with `![` are IMMUTABLE CODE. Copy them character-for-character. Do NOT translate text inside `[...]` or `(...)`. Do NOT add spaces inside brackets.
41+
4. **Formatting**: Keep all HTML tags, markdown links, and emojis exactly as is.
4242
5. **Terminology**: Keep English technical terms (GPU, CLI, VRAM, Docker, CUDA) in English.
4343
6. **Context**:
4444
- 'Enforcement' = Policy restriction (e.g., JA: 制限/強制).
4545
- 'Headless' = Server without GUI/display.
4646
- 'Agnostic' = Hardware Independence (JA: 非依存, ZH: 无关性).
47-
7. **Output**: ONLY the translated text. No explanations.
47+
7. **Output**: ONLY the translated README. No code fences. No explanations.
4848
<|END_OF_TURN_TOKEN|>
4949
<|START_OF_TURN_TOKEN|><|USER_TOKEN|>
5050
{text_to_translate}<|END_OF_TURN_TOKEN|>

scripts/translate_western.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@
3232
text_to_translate = original_text
3333

3434
prompt = f"""<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>
35-
You are a professional technical {target_lang_name} translator. Translate the provided README into professional developer-level {target_lang_name}.
35+
You are a professional technical {target_lang_name} translator.
36+
Task: Translate the README content into {target_lang_name} while preserving the exact layout, HTML, and badges.
3637
37-
CRITICAL RULES:
38-
1. **Navigation Bar**: The top HTML block (`<div align="center">...</div>`) containing language links MUST remain EXACTLY the same. Do NOT translate the filenames or language names inside it.
39-
2. **Badges**: Do NOT translate the text inside badge links (e.g., `![License]`, `![Python]`). Keep the URLs exactly as is.
40-
3. **Logo**: Keep the logo HTML block (`<div style="text-align:center...`) exactly as is.
41-
4. **Formatting**: Preserve all emojis and HTML/Markdown tags exactly.
42-
5. **Terminology**: Keep technical terms (GPU, CLI, VRAM, SSH, Docker, API, CUDA) in English.
43-
6. **No Talk**: Output ONLY the translated text. Do not wrap the output in markdown code fences (```).
38+
STRICT RULES:
39+
1. **Navigation Bar**: The first block `<div align="center">...</div>` is IMMUTABLE. Copy it exactly. Do NOT translate "English", "Deutsch", etc.
40+
2. **Logo**: The block `<div style="text-align:center...` is IMMUTABLE. Copy it exactly.
41+
3. **Badges**: Lines starting with `![` (e.g., `![License]...`) are IMMUTABLE CODE. Copy them character-for-character. Do NOT translate "License", "Python", "Version".
42+
4. **Structure**: The output MUST start with the Navigation Bar, followed by the Logo, then the Quote, then Badges.
43+
5. **Formatting**: Keep all HTML tags, markdown links, and emojis exactly as is.
44+
6. **Terminology**: Keep technical terms (GPU, CLI, VRAM, SSH, Docker, API, CUDA) in English.
45+
7. **No Talk**: Output ONLY the translated README. No code fences.
4446
<|END_OF_TURN_TOKEN|>
4547
<|START_OF_TURN_TOKEN|><|USER_TOKEN|>
4648
{text_to_translate}<|END_OF_TURN_TOKEN|>

0 commit comments

Comments
 (0)