Search

PythonReactSEOPDF
GitHub Skill

internationalization

Implement i18n using next-intl. Manage multilingual content in en.json and ja.json. Apply translation patterns for UI and dynamic content.

ykzts☆ 0 Repository stars0 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill instructions

Internationalization (i18n)

このスキルは、Bingifyの多言語対応とメッセージ管理をカバーします。

概要

Bingifyはnext-intlを使用して、英語 (en) と日本語 (ja) をサポートしています。

ロケール別ルート

/                   # 英語版ホーム
/dashboard          # 英語版ダッシュボード
/ja/                # 日本語版ホーム
/ja/dashboard       # 日本語版ダッシュボード

メッセージファイル

messages/ja.JSON
{
  "common": {
    "app_name": "Bingify",
    "sign_in": "ログイン",
    "home": "ホーム"
  }
}

クライアントコンポーネント

"use client";

import { useTranslations } from "next-intl";

export function Dashboard() {
  const t = useTranslations("dashboard");
  return <h1>{t("title")}</h1>;
}

サーバーコンポーネント

import { getTranslations } from "next-intl/server";

export async function Page() {
  const t = await getTranslations("dashboard");
  return <h1>{t("title")}</h1>;
}

言語選択

"use client";

import { useLocale } from "next-intl";
import { useRouter } from "next-intl/navigation";

export function LanguageSwitcher() {
  const locale = useLocale();
  const router = useRouter();

  return (
    <button onClick={() => router.push("/", { locale: "ja" })}>日本語</button>
  );
}

参考

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-01-20
Index updated
2026-01-26
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!