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

translation-strings

できること

このスキルは、ソフトウェアプロジェクトで翻訳用のテキストがどのように準備されているかを確認します。複数の言語に対応するためにアプリを準備している開発者向けです。

使う場面

  • ✓プロジェクトが、テキストと数値をつなげて翻訳文を作っているとき。
  • ✓新しいアプリの翻訳ライブラリを設定するとき。
  • ✓新しい言語に向けて、コード内の利用者向けテキストを準備するとき。

スキルのリンク

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

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

使い方

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

貼り付け用メッセージ

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

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.

repo: thedaviddias/Front-End-Checklist

人気

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

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

0

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

コメント

  • …

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

似ているスキル