Communitygithub.com

ComeOnOliver/skillshub

Next.jsウェブサイトに多言語サポートを追加し、hreflangタグ、ローカライズされたサイトマップ、言語別コンテンツを含む適切なSEO設定を実現します。新しい言語の追加、i18nのセットアップ、国際SEOの最適化、またはユーザーがローカリゼーション、翻訳、多言語、日本語・韓国語・中国語などの特定の言語に言及したときに使用します。

skillshub とは?

このスキルは、Next.jsベースのウェブサイトに多言語サポート(i18n)を導入し、国際SEOのベストプラクティスを適用するための完全なワークフローを提供します。具体的には、hreflangタグの自動生成、ローカライズされたサイトマップの更新、言語固有のメタデータ設定など、検索エンジンが多言語サイトを正しくクロール・インデックスできるようにするための一連の手順を実装します。対応言語は英語、日本語、中国語を中心に、韓国語、ポルトガル語、スペイン語、フランス語、ドイツ語、アラビア語など幅広くカバー可能です。このスキルは、AI翻訳による高速な初期翻訳と、人間による品質レビューを組み合わせたアプローチを推奨しており、翻訳ファイルの管理、設定ファイルの更新、検証・テストの各ステップをチェックリスト形式で追跡できます。Next.jsの多言語ルーティング(next-intl)に対応しており、Claude Code、Codex、CursorなどのAIエージェントから呼び出して、国際化プロジェクトを効率的に進めることができます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/zhanlincui/internationalizing-websites

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

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

ドキュメント

ウェブサイトの国際化

Next.jsウェブサイトに多言語サポートを追加し、SEOのベストプラクティスを実践するための完全なワークフローです。

このスキルを使用するタイミング

  • 既存のウェブサイトに新しい言語版を追加する場合
  • 新しいウェブサイトにi18n(国際化)を設定する場合
  • 複数言語向けのSEOを構成する場合
  • ユーザーが「言語を追加」、「翻訳」、「ローカリゼーション」、「hreflang」、「多言語」に言及した場合

対応言語

一般的なターゲット市場:

  • 🇺🇸 英語(en) - グローバル市場
  • 🇯🇵 日本語(ja) - アジア市場
  • 🇨🇳 中国語(zh) - 中国市場

拡張サポート対象:

  • 韓国語(ko)、ポルトガル語(pt)、スペイン語(es)、フランス語(fr)、ドイツ語(de)
  • アラビア語(ar)、ベトナム語(vi)、ヒンディー語(hi)、インドネシア語(id)、タイ語(th)
  • 繁体字中国語(zh-hk)、イタリア語(it)、ロシア語(ru)

国際化ワークフロー

このチェックリストをコピーして進捗を追跡してください:

i18n 進捗状況:
- [ ] ステップ 1: ベース言語ファイルの準備
- [ ] ステップ 2: 新しい言語ファイルの追加
- [ ] ステップ 3: 設定ファイルの更新
- [ ] ステップ 4: 翻訳の追加
- [ ] ステップ 5: SEO要素の設定
- [ ] ステップ 6: 検証とテスト

ステップ 1: ベース言語ファイルの準備

テンプレートとして英語(en.json)ファイルが存在することを確認します。

必要なディレクトリ:

  • i18n/messages/en.json - メイン翻訳
  • i18n/pages/landing/en.json - ランディングページの翻訳

構造の確認:

# ベースファイルが存在するか確認
ls i18n/messages/en.json
ls i18n/pages/landing/en.json

存在しない場合は、ウェブサイト用の完全な翻訳キーを含むファイルを作成します。

ステップ 2: 新しい言語ファイルの追加

言語追加スクリプトを実行します:

node scripts/i18n-add-languages.mjs

このスクリプトの機能:

  • すべてのターゲット言語ファイルに en.json をコピー
  • i18n/locale.ts を新しいロケールで更新
  • i18n/request.ts を言語マッピングで更新
  • public/sitemap.xml を新しい言語URLで更新

スクリプト設定(i18n-add-languages.mjs 内):

  • languages 配列 - 追加する言語のリスト
  • languageNames オブジェクト - 言語の表示名
  • targetDirs 配列 - 翻訳ファイルを含むディレクトリ

詳細な手順については WORKFLOW.md を参照してください。

ステップ 3: 設定の更新を確認

i18n/locale.ts の確認:

export const locales = ["en", "ja", "zh", "ko", ...];

export const localeNames: any = {
  en: "English",
  ja: "日本語",
  zh: "中文",
  ko: "한국어",
  ...
};

i18n/request.ts の確認:

  • 言語コードマッピングが設定されている
  • zh-CN → zh、zh-HK → zh-hk などのマッピングが存在する

public/sitemap.xml の確認:

  • すべての言語バージョンがリストされている
  • 各URLに hreflang タグが存在する

ステップ 4: 翻訳の追加

オプション A: AI翻訳を使用(高速だがレビューが必要):

# 構造化データと価格翻訳を追加
node scripts/i18n-add-schema.js

スクリプトの translations オブジェクトで翻訳を設定します。

オプション B: 手動翻訳(品質面で推奨):

各言語ファイルを編集して適切な翻訳を追加します:

# 言語ファイルを開く
code i18n/messages/ja.json

翻訳のベストプラクティス:

  • 可能な場合はネイティブスピーカーを利用する
  • ターゲット言語でSEOキーワードを維持する
  • 単に翻訳するのではなく、コンテンツを地域の文化に適応させる
  • 書式(プレースホルダー、変数)を一貫して保つ

言語コードのリファレンスについては reference/locale-codes.md を参照してください。

ステップ 5: SEO要素の設定

hreflangタグ - サイトマップ経由で自動生成されますが、確認は必要です:

完全なガイドについては reference/hreflang-guide.md を参照してください。

ローカライズされたメタタグ - 各言語ファイルで翻訳します:

{
  "metadata": {
    "title": "あなたのサイトタイトル",
    "description": "あなたのSEOディスクリプション"
  }
}

URL構造 - 正しい形式を確認します:

  • 英語: https://example.com/ または https://example.com/en/
  • 日本語: https://example.com/ja/
  • 中国語: https://example.com/zh/

ステップ 6: 検証とテスト

プロジェクトをビルド:

npm run build

重要: 先に進む前にエラーを修正してください。

手動テスト:

  1. 言語切り替え:

    • 各言語バージョンにアクセス
    • 言語切り替え機能がすべての言語を表示していることを確認
    • 各言語リンクをクリックし、正しいページが読み込まれることを確認
  2. コンテンツ表示:

    • すべてのページが各言語で正しくレンダリングされていることを確認
    • 未翻訳のテキストがないか確認(非英語ページで英語が表示されていないか)
    • 特殊文字(日本語、中国語、アラビア語など)が正しく表示されるかテスト
  3. SEO要素:

    • <html lang="..."> 属性がページの言語と一致しているか確認
    • <link rel="alternate" hreflang="..."> タグが存在するか確認
    • メタタグが正しい言語であるか確認

自動検証:

# サイトマップを確認
curl https://your-site.com/sitemap.xml | grep hreflang

# hreflangを検証(オンラインツールを使用)
# Google Search Console > 国際化 > hreflang

SEOチェックリスト - reference/seo-checklist.md を参照。

検証に失敗した場合:

  • エラーメッセージを注意深く確認
  • 設定ファイルのタイプミスをチェック
  • 言語コードが正しいか確認
  • ステップ3に戻って問題を修正

すべての検証が合格した場合のみ先に進んでください。

重要な注意事項

言語コードの標準

ISO 639-1(2文字コード)とオプションの地域バリアントを使用します:

  • en - 英語
  • ja - 日本語
  • zh - 簡体字中国語
  • zh-hk - 繁体字中国語(香港)
  • pt - ポルトガル語
  • pt-br - ブラジルポルトガル語

完全なリストについては reference/locale-codes.md を参照。

SEOへの影響

正しいi18nがSEOを改善する理由:

  • ユーザーを母国語でターゲット化
  • 重複コンテンツペナルティの回避
  • 検索エンジンが正しい言語バージョンを提供できるようにする

避けるべき一般的なSEOの間違い:

  • ❌ IPベースの自動リダイレクト(検索エンジンがすべてのバージョンをクロールできなくなる)
  • ❌ hreflangタグの欠落(重複コンテンツの問題を引き起こす)
  • ❌ 言語間で一貫性のないURL構造
  • ❌ 未翻訳のメタタグ

翻訳品質

AI翻訳 vs 人間による翻訳:

  • ✅ AI: 高速、低コスト、初期ドラフトに適している
  • ⚠️ AI: 文化的なニュアンスを見逃す可能性があり、レビューが必要
  • ✅ 人間: 高品質、文化適応が可能
  • ⚠️ 人間: 遅い、高コスト

推奨アプローチ:

  1. AIを使用して初期翻訳を生成
  2. ネイティブスピーカーがレビューして洗練
  3. ターゲット市場のユーザーでテスト
  4. フィードバックに基づいて反復改善

Next.js i18n ルーティング

このシステムはルーティングに next-intl を使用しています:

  • URLからの自動ロケール検出
  • 言語切り替えコンポーネント
  • ローカライズされたナビゲーション

設定は i18n/locale.ts と i18n/request.ts で行います。

国際化後のタスク

言語を追加した後:

  1. 更新したサイトマップをGoogle Search Consoleに送信
  2. 言語/地域ごとに個別のSearch Consoleプロパティを作成
  3. アナリティクスで国際的なオーガニックトラフィックを監視
  4. 言語ごとにコンバージョン率が異なる場合はA/Bテストを実施
  5. 国際的なクロールエラーに関するアラートを設定

スクリプトの場所

すべてのi18nスクリプトは scripts/ ディレクトリにあります:

  • i18n-add-languages.mjs - 新しい言語ファイルの追加
  • i18n-add-schema.js - 構造化データ翻訳の追加

参考資料

トラブルシューティングについては WORKFLOW.md のトラブルシューティングセクションを参照。

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

関連スキル