You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve handling of singular strings in plural-form batches
When batches contain both singular and plural entries, the AI
sometimes returns `<f0>...<fN>` form tags for singular strings
(e.g., "30 files"). The parser accepted all forms, and the
post-validator blanked them for placeholder mismatches.
- Clarify prompt to show both formats when batch has mixed entries
- Extract only f0 when AI returns form tags for singular entries
- Initialize singular entries with 1 msgstr slot instead of pluralCount
Copy file name to clipboardExpand all lines: config/prompt.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,21 @@ You are a professional translator specializing in software localization. Your ta
3
3
### Instructions
4
4
5
5
1.**Translate each XML tag** and respond with the translated content in the same XML structure.
6
-
2.**CRITICAL — Preserve placeholders exactly**: The translation MUST contain the **exact same placeholders** as the source (%s, %d, %1$s, etc.) — no more, no fewer. If none in source, none in translation. Use ASCII %, never %.
6
+
2.**CRITICAL — Preserve placeholders exactly**: The translation MUST contain the **exact same placeholders** as the source (%s, %d, %1$s, etc.) — no more, no fewer. If none in source, none in translation. Do NOT add %d or any placeholder that is not in the source. Always use standard ASCII percent sign (%), never the fullwidth % (U+FF05).
7
7
3.**Preserve bracket placeholders**: [example], [product], {value} — keep as-is. Do NOT convert to %s/%1$s.
8
8
4.**Preserve bracket tags**: [strong], [/strong], [link], [/link] — keep as-is. Do NOT convert to HTML.
9
9
5.**Preserve formatting**: Keep line breaks, HTML tags, trailing whitespace unchanged.
10
10
6.**Context/comments**: Use provided context and comment attributes.
- Japanese/Chinese/Korean(1): f0 only, MUST keep %d
11
+
7.**Singular vs. plural entries**:
12
+
-**Singular entries** (no `<singular>`/`<plural>` tags): Provide ONE translation. Do NOT use `<f0>`, `<f1>`, etc. — just `<t i="N">translation</t>`. Translate the string literally, even if it contains a number (e.g., "30 files" → translate as-is, do NOT split into plural forms).
13
+
-**Plural entries** (with `<singular>` and `<plural>` tags): Provide exactly {{PLURAL_COUNT}} DISTINCT translations using `<f0>`, `<f1>`, etc. Only use placeholders that exist in the source — if the source uses [number] instead of %d, use [number] in ALL forms, never add %d. Rules:
14
+
- Arabic(6): f0=zero(plural), f1=one(singular, may drop %d if source has it), f2=two(dual تان/تين, may drop %d if source has it), f3=few(plural), f4=many(plural), f5=other(plural)
0 commit comments