本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2981

pluralization

できること

このスキルは、「3件のアイテムがあります」のような件数をサイトがどう表示しているかを確認し、各言語で複数形が正しくなるようにコードを更新します。多言語のアプリを作る開発者向けです。

使う場面

  • ✓アプリの翻訳で件数や複数形がどう書かれているか確認するようエージェントに頼むとき。
  • ✓言語にとって複数形が不適切で、翻訳された文章が不自然に読めるとき。
  • ✓国際化のライブラリを設定し、複数形の選択を正しく扱いたいとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/pluralization/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/pluralization/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のアプリでは、一部の言語で「1 items」のような表示になります。すべての言語について、複数形の扱いを直してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、件数をプラス記号で文字列に連結している箇所や、単数と複数だけを確認している箇所を探します。それらをIntl.PluralRulesやICUのメッセージ構文に置き換え、各言語に正しい形が選ばれるようにします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Handle plural forms with Intl.PluralRules or ICU MessageFormat

Pluralization rules vary dramatically across languages — what works as a simple singular/plural branch in English produces grammatically wrong output in Arabic, Russian, Polish, and dozens of other languages. Shipping incorrect plurals signals low translation quality and breaks trust with native speakers in target markets.

Quick Reference

  • English has 2 plural forms but Arabic has 6 and Russian has 3
  • Never concatenate a count with a string like '"You have " + count + " items"'
  • Use Intl.PluralRules to select the right message key per locale
  • ICU MessageFormat in react-intl or i18next handles plural selection automatically

Check

Find all places in this codebase where a count value is concatenated with a string or where only singular/plural branching is used, without Intl.PluralRules or ICU plural syntax.

Fix

Replace count string concatenation and binary singular/plural logic with Intl.PluralRules-based key selection or ICU MessageFormat plural syntax so that all CLDR plural categories are covered for every target locale.

Explain

Explain why languages have different numbers of plural forms, what CLDR plural categories are, and how Intl.PluralRules and ICU MessageFormat solve pluralization correctly across locales.

Code Review

Review translation files and components that render counts. Flag any strings that concatenate a number with text, any ternary that picks only between "singular" and "plural", and any i18next or react-intl message that is missing plural keys required by the target locale.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/i18n/pluralization

よくある質問

単数と複数の二つだけでは、なぜ不十分なのですか?

このスキルによると、言語ごとに大きく異なり、英語は複数形が二つですが、アラビア語は六つ、ロシア語は三つあります。

Intl.PluralRulesとは何ですか?

ブラウザーに標準で備わった機能で、特定の言語で数に対応する正しい複数形の区分を選びます。

人気のライブラリでも使えますか?

このスキルは、複数形の選択を扱うreact-intlやi18nextなどのライブラリのICU MessageFormatに触れています。

詳細

作者による元の説明

Use when reviewing string concatenation involving counts, translation key lookups, or i18n library configurations to check whether plural forms are handled correctly for all target locales.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2981
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル