Communitygithub.com

JantonioFC/skillsbank

国際化とローカライゼーションのパターン。ハードコードされた文字列の検出、翻訳管理、ロケールファイル、RTL対応。

skillsbank とは?

このスキルは、アプリケーションの国際化(i18n)とローカライゼーション(L10n)を実装するための包括的なベストプラクティスを提供します。React、Next.js、Pythonなど、主要なフレームワーク向けの具体的なコードパターンを示し、翻訳キーの使用法やファイル構造の設計指針を説明します。さらに、RTL(右から左)言語への対応方法、日付/数値フォーマットのロケール対応、複数形処理など、実際の開発で直面する一般的な課題に対する解決策を網羅しています。このスキルは、Claude Code、Cursor、CodexなどのAIエージェントがコードベースを分析・修正する際に、i18nの導入や既存のローカライゼーションの改善を支援するために設計されています。付属のPythonスクリプト(i18n_checker.py)を使用して、ハードコードされた文字列や欠落した翻訳を自動検出することも可能です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JantonioFC/skillsbank/tree/HEAD/plugins/antigravity-awesome-skills-claude/skills/i18n-localization

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

i18n & Localization(国際化とローカライゼーション)

国際化(i18n)とローカライゼーション(L10n)のベストプラクティス


1. コア概念

用語意味
i18n国際化 - アプリを翻訳可能にする
L10nローカライゼーション - 実際の翻訳
Locale言語 + 地域(en-US, tr-TR)
RTL右から左へ書く言語(アラビア語、ヘブライ語)

2. i18nを導入すべきタイミング

プロジェクトの種類i18nは必要か?
公開Webアプリ✅ 必要
SaaS製品✅ 必要
社内ツール⚠️ 場合による
単一地域向けアプリ⚠️ 将来性を考慮
個人プロジェクト❌ 任意

3. 実装パターン

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(_("私たちのアプリへようこそ"))

4. ファイル構造

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

5. ベストプラクティス

推奨事項 ✅

  • 翻訳キーを使用し、生のテキストを使わない
  • 翻訳を機能ごとに名前空間で分ける
  • 複数形に対応する
  • 日付・数値フォーマットをロケールごとに処理する
  • 最初からRTLを考慮して設計する
  • 複雑な文字列にはICUメッセージ形式を使用する

避けるべきこと ❌

  • コンポーネント内に文字列をハードコードする
  • 翻訳済み文字列を連結する
  • テキストの長さを過小評価する(ドイツ語は英語より約30%長い)
  • RTLレイアウトを忘れる
  • 同じファイル内で言語を混在させる

6. よくある問題

問題解決策
翻訳が見つからないデフォルト言語にフォールバック
ハードコードされた文字列リンター・チェッカースクリプトを使用
日付形式Intl.DateTimeFormatを使用
数値形式Intl.NumberFormatを使用
複数形処理ICUメッセージ形式を使用

7. RTL対応

/* CSS論理プロパティ */
.container {
  margin-inline-start: 1rem;  /* margin-left ではない */
  padding-inline-end: 1rem;   /* padding-right ではない */
}

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

8. チェックリスト

リリース前に確認する項目:

  • すべてのユーザー向け文字列が翻訳キーを使用している
  • サポートするすべての言語のロケールファイルが存在する
  • 日付・数値のフォーマットにIntl APIを使用している
  • RTLレイアウトのテスト済み(該当する場合)
  • フォールバック言語が設定されている
  • コンポーネント内にハードコードされた文字列がない

スクリプト

スクリプト目的コマンド
scripts/i18n_checker.pyハードコードされた文字列と欠落している翻訳を検出python scripts/i18n_checker.py <project_path>

使用タイミング

このスキルは、概要に記載されたワークフローやアクションを実行する場合に適用されます。

制限事項

  • このスキルは、タスクが上記の範囲に明確に一致する場合にのみ使用してください。
  • 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
  • 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して明確化を求めてください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

JantonioFC/skillsbank

AI-powered image editing with style transfer and object removal

JantonioFC/skillsbank

Analise e auditoria de editais de leilao judicial e extrajudicial. Riscos ocultos, clausulas perigosas, debitos, ocupante e classificacao da oportunidade.

JantonioFC/skillsbank

Embed Photopea in web apps using photopea.js. Covers embedding, file I/O, scripting, exporting, layers, text, filters, and the full Photoshop-compatible API.

JantonioFC/skillsbank

Best practices for Remotion - Video creation in React

JantonioFC/skillsbank

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

JantonioFC/skillsbank

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

JantonioFC/skillsbank

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

JantonioFC/skillsbank

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

JantonioFC/skillsbank

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

JantonioFC/skillsbank

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

JantonioFC/skillsbank

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

JantonioFC/skillsbank

Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results, agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending

JantonioFC/skillsbank

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

JantonioFC/skillsbank

When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' 'audience targeting,' 'Google Ads,' 'Facebook ads,'...

JantonioFC/skillsbank

Create AI avatar and talking head videos with OmniHuman, Fabric, PixVerse via inference.sh CLI. Models: OmniHuman 1.5, OmniHuman 1.0, Fabric 1.0, PixVerse Lipsync. Capabilities: audio-driven avatars, lipsync videos, talking head generation, virtual presenters. Use for: AI presenters, expla...

JantonioFC/skillsbank

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awarene...

JantonioFC/skillsbank

Generate AI videos with Google Veo, Seedance, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, lipsync, avatar animation, video upscaling, fole...

JantonioFC/skillsbank

Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

JantonioFC/skillsbank

Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

JantonioFC/skillsbank

You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message.

関連スキル