Communitygithub.com

ASoudy/AGS

国際化(i18n)と地域化(L10n)のパターン。ハードコードされた文字列の検出、翻訳管理、ロケールファイル、RTLサポート。

AGS とは?

このスキルは、アプリケーション開発における国際化(i18n)と地域化(L10n)のベストプラクティスを提供します。主にReact、Next.js、Python(gettext)などのフレームワークを対象としており、翻訳キーを使用した文字列管理、ロケールファイルの構造設計、日付や数値のフォーマット、RTL(右横書き)言語への対応など、多言語対応に必要な実装パターンを網羅しています。スキルには、ハードコードされた文字列や不足している翻訳を自動検出するPythonスクリプト(scripts/i18n_checker.py)も含まれており、品質チェックを自動化できます。このスキルは、プロジェクト開始時から国際化を計画している場合や、既存アプリに多言語サポートを追加する際に特に有用です。ただし、環境固有のバリデーションや専門家によるレビューの代わりにはならないため、適切な確認とテストを推奨します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/AGAS/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(_("Welcome to our app"))

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.

ASoudy/AGS

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

One sentence - what this skill does and when to invoke it

ASoudy/AGS

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ASoudy/AGS

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

ASoudy/AGS

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.

ASoudy/AGS

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

ASoudy/AGS

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

ASoudy/AGS

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

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

ASoudy/AGS

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

ASoudy/AGS

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.

ASoudy/AGS

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

ASoudy/AGS

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

関連スキル