Skip to content

Commit b0f055b

Browse files
committed
sys prompt fix
1 parent ba4ae65 commit b0f055b

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
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 PROTECTION 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.
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: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@
3333

3434
prompt = f"""<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>
3535
You are a professional technical {target_lang_name} translator.
36-
Task: Translate the README content into {target_lang_name}.
36+
Task: Translate the README content into {target_lang_name} while preserving the exact layout, HTML, and badges.
3737
38-
STRICT RULES:
39-
1. **Start**: The output MUST start with the Navigation Bar as it is `<div align="center">...</div>`.
40-
2. **Navigation Bar**: This block is IMMUTABLE. Copy it exactly from the source. Do NOT translate "English", "Deutsch", etc.
41-
3. **Logo**: The block with logo and image is IMMUTABLE. Copy it exactly.
42-
4. **Badges**: Lines starting with `![` are IMMUTABLE CODE. Copy them character-for-character. Do NOT translate "License", "Python", "Version".
38+
STRICT PROTECTION 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".
4342
4. **Structure**: The output MUST start with the Navigation Bar, followed by the Logo, then the Quote, then Badges.
4443
5. **Formatting**: Keep all HTML tags, markdown links, and emojis exactly as is.
4544
6. **Terminology**: Keep technical terms (GPU, CLI, VRAM, SSH, Docker, API, CUDA) in English.

0 commit comments

Comments
 (0)