translation-strings
できること
このスキルは、ソフトウェアプロジェクトで翻訳用のテキストがどのように準備されているかを確認します。複数の言語に対応するためにアプリを準備している開発者向けです。
使う場面
- ✓プロジェクトが、テキストと数値をつなげて翻訳文を作っているとき。
- ✓新しいアプリの翻訳ライブラリを設定するとき。
- ✓新しい言語に向けて、コード内の利用者向けテキストを準備するとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/translation-strings/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“アプリは「Found ' + count + ' results」のように、コードで文を組み立てています。翻訳できるようにするにはどうすればよいですか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、テキストの断片を組み合わせて作られた文を見つけ、名前付きのプレースホルダーを使う一つのメッセージに置き換えます。複数形などは、翻訳ライブラリが扱います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Write internationalisation-friendly translation strings
Naive string concatenation produces untranslatable sentences because word order varies dramatically across languages. A pattern like "Found " + count + " results" cannot be translated correctly into languages where the number appears in a different position or where the noun form changes depending on the count. Bad i18n strings force translators to work around developer mistakes — or simply leave content untranslated.
Quick Reference
- Never concatenate translated strings with variables — use named placeholders
- Use ICU MessageFormat for pluralisation, gender, and select patterns
- Keep translation keys descriptive and scoped to their feature context
- Extract all user-visible strings — do not hardcode any copy in components
Check
Check whether translation strings use proper message formatting with placeholders rather than string concatenation.
Fix
Replace concatenated translation strings with ICU message format patterns and ensure pluralisation is handled via the library, not conditionals.
Explain
Explain why string concatenation breaks translations and how ICU MessageFormat handles variable word order, pluralisation, and gender.
Code Review
Review components and utility functions for hardcoded user-visible strings, string concatenation involving translated text, and missing plural forms.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/javascript/translation-strings
よくある質問
ICU MessageFormat とは何ですか?
数値、複数形、性別を含む翻訳可能なメッセージを書くための標準的な方法です。
テキストの断片をつなげてはいけないのはなぜですか?
言語によって語順が違うため、つなげた断片は正しく翻訳できないことが多いからです。
コンポーネントに直接書かれたテキストはどうすべきですか?
利用者に見えるテキストは、すべてコンポーネントに直接書かず、翻訳ファイルに分けるべきだとこのスキルは説明しています。
詳細
作者による元の説明
Use when reviewing a codebase for internationalisation readiness, setting up an i18n library, or preparing strings for a new locale.
人気
- GitHubのスター
- 75k
- ランキング
- #3062
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。