fix(fr): translate issue.origin in too_big/too_small errors (fix #5825)#5845
Conversation
The pluralization assertions used `toContain` where singulars are substrings of plurals (e.g. "21 élément" inside "21 éléments"), so they passed without testing pluralization (which fr.ts does not implement). Replaced with the same focused style as `es.test.ts`: exact-message assertions covering the actual fix — `issue.origin` translation in `too_big`/`too_small` plus a sanity check on `invalid_type`.
|
TL;DR — French locale error messages for Key changes
Summary | 2 files | 2 commits | base:
The
|
After #5845 added `string: "chaîne"` to the French TypeDictionary, the resolution test fixture (which checks the safeParse output under the `fr` locale) was still asserting the pre-translation message "Entrée invalide : string attendu, nombre reçu". CI on main has been red since 37ac1ba. Update all three entrypoints (`index.ts`, `index.cts`, `index.mts`) to match the actual translated output.
|
Merged. Trimmed the test file in Note: this comment was produced by an AI coding assistant. |
|
Landed in Zod 4.4 |
Summary
Fixed issue #5825 - French locale issue.origin not translated in too_big and too_small errors.
Problem
When using Zod's French locale (fr), error messages for too_big and too_small validations contained untranslated issue.origin values (e.g., "Trop grand : number doit être <=24" instead of "Trop grand : nombre doit être <=24").
Solution
Files Changed