A message can sound natural yet fail at runtime because a required variable disappeared or a plural branch is missing. Give the model the message schema, variable types, and supported categories, then require a structural diff before language review. Placeholder names are application contracts; they are not free words to translate. Plural selection belongs to the locale-aware message engine, not an English singular-versus-other shortcut invented in prose. Test representative boundary counts in the actual engine and keep the rendered result in the review packet.
Localization prompts: preserve variables and plural branches
Operational case
Harbor's HP-07 candidate omits {deliveryWindow}, so the notice cannot show the selected time. HP-12 has a count-dependent message but lacks a category the selected locale requires. The reviewer first catches the missing variable and branch by comparing parsed message structures, then renders several count values to inspect grammar and layout. A model may propose repairs, but the catalog parser and language reviewer must accept them before the key moves to pass.
HP-07 required: {deliveryWindow}; candidate: missing
HP-12 required: locale-specific plural branches; candidate: incomplete
Gate 1: parse and compare message structure
Gate 2: render boundary counts and review languagePerformance and review cost
Parsing N message patterns is O(total pattern length); set comparison of V placeholders is O(V) expected time per key. Rendering several count cases per plural message adds a small, deliberate test matrix. This is cheaper than discovering a blank runtime value after publication, and it keeps linguistic judgment separate from deterministic structure checks.
Common Mistakes
- Do not translate placeholder identifiers.
- Do not infer every locale's plural behavior from English.
- Do not approve a structurally valid message without rendered language review.
Connected lessons
- Prompt engineering applications
- Prompt Engineering
- Translation prompts: preserve terms and machine placeholders
- Locale-aware prompts: keep values typed until rendering
- Localization prompts: define the locale and message contract
- Localization prompts: test mixed-direction identifiers
- Localization prompts: render typed dates, numbers, and units
- Localization prompts: reconcile terminology and tone
- Localization prompts: use pseudolocale and real layout checks
- Localization prompts: gate release on catalog and rendered retests
- Project: review Harbor's localized delivery notices
- Localization QA prompt decisions
