internationalization
Implement i18n using next-intl. Manage multilingual content in en.json and ja.json. Apply translation patterns for UI and dynamic content.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
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>
);
}
参考
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!