{"slug":"icu-plural-messages","name":"ICU Plural Messages (per-language CLDR categories)","version":"1.0.0","updated_at":"2026-10-08T14:46:43.855Z","use_when":"Writes and fixes ICU MessageFormat strings for several locales at once, with exactly the plural categories each language uses (one, few, many, other and the rest), the mandatory other arm, exact-number arms such as =0, selectordinal, select, offset, nested messages and correct apostrophe quoting. Answers with a bare JSON map of locale code to message. Use when asked to write or translate a plural message, an ICU string, a count label such as \"3 files\", an ordinal such as \"1st, 2nd, 3rd\", a gender or enum select, or to fix a message that shows the wrong word form or fails to parse in react-intl, FormatJS, Angular, Flutter intl or Java MessageFormat.","not_for":"Gettext .po files, i18next key suffixes, Rails YAML plurals, or translating whole screens. It writes messages from the CLDR language rules but does not run your library, so a library with an older CLDR may differ for a few languages. Give it the text and the number variable; it returns the message.","languages":["en"],"tags":["icu-messageformat","plurals","i18n","cldr","localization","react-intl","selectordinal"],"category":"translation","category_url":"https://aiskills402.com/categories/translation","keywords":["plural message","ICU string","plural categories","selectordinal","count label"],"faq":[{"q":"Which plural categories does each language need?","a":"The skill carries a table checked against the Unicode CLDR chart for more than thirty languages: Japanese, Korean and Vietnamese only other; English and German one and other; French, Spanish and Italian one, many and other; Russian and Polish one, few, many and other; Czech with a many arm that only fractions reach; Hebrew one, two and other; Arabic all six. Latvian has a zero form, Slovenian and Irish dual forms. Unknown languages follow the CLDR definition, never a neighbour."},{"q":"What is the difference between =0 and zero, and what about apostrophes?","a":"The arm =0 matches the exact number in every language, while zero is a category only Arabic, Welsh and Latvian have, so an English zero arm never fires. An apostrophe quotes only when it sits directly before a brace: the skill doubles it before a placeholder (l''{name}) and quotes literal braces, the two cases that break a parse. A stray unquoted brace in running text, such as a keyboard hint, is the other classic crash, and the skill quotes it. Spelling the typographic apostrophe avoids the issue entirely."},{"q":"Does it handle offset, selectordinal, nested select and repairs?","a":"Yes: offset:1 for the you-and-others wording, English one, two, few, other ordinals (and other-only for German or Japanese), select with a full plural inside every arm, and repair of an existing message such as a Russian string with only one and other, or an English one that lacks the other arm. Placeholders, variable names and keywords stay in English; only the words inside the arms change, and gendered verbs get their own arm."},{"q":"Does it help Claude Sonnet?","a":"On our 23 cases Sonnet scored 23 of 23 both with the skill and without it, once its fence was stripped. The skill helped Haiku, which went from 20 to 23: alone it left out the many arm that Czech, French, Spanish, Italian and Brazilian Portuguese need (millions, fractions). Parse the JSON it returns in your own library, because the skill never runs it."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"{count} files","output_excerpt":"{\"en\":\"{count, plural, one {# file} other {# files}}\",\"ja\":\"{count, plural, other {#個のファイル}}\",\"ar\":\"{count, plural, zero {لا ملفات} one {ملف واحد} two {ملفان} few {# ملفات} many {# ملفًا} other {# ملف}}\"}"}],"page_url":"https://aiskills402.com/skills/icu-plural-messages","markdown_url":"https://aiskills402.com/skills/icu-plural-messages.md","image_url":"https://cdn.aiskills402.com/og/skills/icu-plural-messages/50106a0b.png","related_url":"https://api.aiskills402.com/v1/skills/icu-plural-messages/related","purchases_count":null,"tested":{"date":"2026-10-08","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"Wrote usable ICU messages for all 23 cases, read by hand: Japanese, Korean and Chinese got no one arm, English got =0 rather than a zero arm, the apostrophe before a placeholder was doubled and a literal brace was quoted, an offset:1 message counted the viewer out, and the fix cases added the missing Russian forms and the missing other arm."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Also 23 of 23 with the skill: the same arms per language as Sonnet, including many for French, Spanish, Italian, Czech and Brazilian Portuguese, which it left out without the skill."},"note":"Twenty-three requests written by us, in two to four locales each: plain counts, exact zero, ordinals, select with a nested plural, offset, other-only languages, the dual and zero languages, a literal brace, an apostrophe before a placeholder, two repairs and a planted instruction. Each answer is scored by regexes on the message strings: the arms the language needs where the wording differs, other always, and a dead arm only where the case is about it. The checks were relaxed AFTER this run to accept every working message: an offset message may use =2 instead of one, an English zero case needs no one arm when =1 is given, Turkish may be other only, and Irish and the Slavic day cases require only the arms whose words differ. One run per model and case; the numbers below are from rescoring the recorded answers with the relaxed checks.","baseline":{"date":"2026-10-08","rows":[{"label":"Messages with the right arms (23 cases)","better":"higher","strong":{"with":{"n":23,"of":23},"without":{"n":23,"of":23}},"weak":{"with":{"n":23,"of":23},"without":{"n":20,"of":23}}}],"note":"The same request on both sides, JSON-only asked for in both; a fence around the answer is removed first. Read by hand, Sonnet without the skill was right everywhere on content (its only miss was a code fence around one answer, which the rescoring strips). Haiku without the skill wrote no many arm for Czech, for French, Spanish and Italian, and for Brazilian Portuguese, so the number one million would show the wrong wording. Everything else Haiku wrote alone passed, including the apostrophe, the literal brace and the other-only languages."},"report_url":null},"price_usd":"0.02","price_micro":20000,"size_bytes":9678,"sha256":"ba77d3d880f6ef71ff6db61c6b6af1ca774b665a1c0d4682caca52dbdf0fb5ce","outline":["Hard rules","Writing a good arm","Work in this order","Short examples"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/icu-plural-messages/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"ICU Plural Messages for Every Language","seo_description":"A tested SKILL.md that writes ICU MessageFormat plurals with the right CLDR categories per language, =0, offset, ordinals and apostrophes. $0.02 once.","versions":[{"version":"1.0.0","date":"2026-10-08","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst release: writes and fixes ICU MessageFormat strings for several locales, with the CLDR plural categories of each language, `=0` versus `zero`, offset, selectordinal, select, nested messages and apostrophe quoting; answers with a bare JSON map locale to message.\n\nFacts re-checked on 2026-10-08: the category table against the Unicode CLDR plural chart (fetched) and against Intl.PluralRules in Node 24 (ICU 78, CLDR 48) for 38 locales; apostrophe, required `other` and `offset` against the ICU user guide page on messages (fetched). \n\nModel runs 2026-10-08, 23 cases, fence stripped: Sonnet 23/23 with and 23/23 without; Haiku 23/23 with and 20/23 without. Sonnet's gain is 0 cases, Haiku's 3 (the many arm). Price set to $0.02 by the measured benefit rule (Sonnet gain at most 1).\n"}]}