Grammatical agreement for localized text — the part printf can't do.
Localized strings constantly need grammar that depends on a value only known at runtime: the right article, the right case suffix, the right particle.
format("hu", "Nyertél ^[a {card}](case: instrumental)!", { card: "kőr ász" });
// → "Nyertél a kőr ásszal!"
format("en", "You drew ^[a {c}](article: indefinite)", { c: "ace" });
// → "You drew an ace"| Repository | What it is |
|---|---|
| i18n-inflect-js | The JavaScript/TypeScript implementation — browser, Node.js and Cordova. Hungarian, English, German, French, Spanish and Korean. |
Ports to other languages are welcome as sibling repositories here.
The most valuable contributions are new languages and corrections from native speakers. If a form comes out wrong in your language, that is worth an issue even without a fix — see CONTRIBUTING.md.