本文へスキップ
Skillpedia
ライティング48k · #4917

i18n-localization

できること

このツールは、アプリケーションを他の言語に翻訳できるように準備するのに役立ちます。翻訳が必要な、コードに直接書かれた文字列を探し、翻訳用ファイルを整理します。

使う場面

  • ✓Webサイトやアプリを他の国でも使ってもらいたいとき。
  • ✓将来翻訳が必要になるかもしれないアプリを作るとき。
  • ✓既存のアプリの翻訳を整理したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/i18n-localization/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“「私のコードを確認して、翻訳されていない文字列を見つけ、翻訳用ファイルに整理してください。」”

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

仕組み

ツールは、コードに直接書かれていて別ファイルに移すべき文字列を探します。翻訳しやすくなるように、その文字列の整理方法を提案します。

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

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

i18n & Localization

Internationalization (i18n) and Localization (L10n) best practices.


1. Core Concepts

Term Meaning
i18n Internationalization - making app translatable
L10n Localization - actual translations
Locale Language + Region (en-US, tr-TR)
RTL Right-to-left languages (Arabic, Hebrew)

2. When to Use i18n

Project Type i18n Needed?
Public web app ✅ Yes
SaaS product ✅ Yes
Internal tool ⚠️ Maybe
Single-region app ⚠️ Consider future
Personal project ❌ Optional

3. Implementation Patterns

React (react-i18next)

import { useTranslation } from 'react-i18next';

function Welcome() {
  const { t } = useTranslation();
  return <h1>{t('welcome.title')}</h1>;
}

Next.js (next-intl)

import { useTranslations } from 'next-intl';

export default function Page() {
  const t = useTranslations('Home');
  return <h1>{t('title')}</h1>;
}

Python (gettext)

from gettext import gettext as _

print(_("Welcome to our app"))

4. File Structure

locales/
├── en/
│   ├── common.json
│   ├── auth.json
│   └── errors.json
├── tr/
│   ├── common.json
│   ├── auth.json
│   └── errors.json
└── ar/          # RTL
    └── ...

5. Best Practices

DO ✅

  • Use translation keys, not raw text
  • Namespace translations by feature
  • Support pluralization
  • Handle date/number formats per locale
  • Plan for RTL from the start
  • Use ICU message format for complex strings

DON'T ❌

  • Hardcode strings in components
  • Concatenate translated strings
  • Assume text length (German is 30% longer)
  • Forget about RTL layout
  • Mix languages in same file

6. Common Issues

Issue Solution
Missing translation Fallback to default language
Hardcoded strings Use linter/checker script
Date format Use Intl.DateTimeFormat
Number format Use Intl.NumberFormat
Pluralization Use ICU message format

7. RTL Support

/* CSS Logical Properties */
.container {
  margin-inline-start: 1rem;  /* Not margin-left */
  padding-inline-end: 1rem;   /* Not padding-right */
}

[dir="rtl"] .icon {
  transform: scaleX(-1);
}

8. Checklist

Before shipping:

  • All user-facing strings use translation keys
  • Locale files exist for all supported languages
  • Date/number formatting uses Intl API
  • RTL layout tested (if applicable)
  • Fallback language configured
  • No hardcoded strings in components

Script

Script Purpose Command
scripts/i18n_checker.py Detect hardcoded strings & missing translations python scripts/i18n_checker.py <project_path>

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問

「i18n」と「L10n」とは何ですか?

「i18n」(国際化)は、アプリを翻訳できるように準備することです。「L10n」(ローカライズ)は、実際に翻訳を行う作業のことです。

「ロケール」とは何ですか?

言語と地域の組み合わせのことです。たとえば、アメリカ英語を表す「en-US」や、ブラジルポルトガル語を表す「pt-BR」のようなものです。

文字列をコードに直接書いてはいけないのはなぜですか?

直接書くと翻訳が難しくなるためです。翻訳キーを別ファイルで管理すると、メインのコードを変更せずに翻訳を管理・更新できます。

詳細

作者による元の説明

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4917
ライセンス
MIT
更新日
2026/10/15

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

0

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

コメント

  • …

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

似ているスキル