ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

i18n-nextjs

Internationalization (i18n) guide for Next.js / Node.js web applications using the App Router. Covers translation file structure, locale routing, SEO metadata per locale, hreflang, structured JSON-LD data, UI component translations, and multi-language sitemap generation. Use when the user asks to: add i18n support, add a new language, translate a page or component, add SEO metadata for multiple locales, implement hreflang, update the sitemap for new locales, or follow i18n best practices in a Next.js project.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/javainthinking/web-i18n-nextjs
Or

i18n for Next.js — Implementation Guide

Core Principles

  • All user-facing features must implement i18n — no hardcoded strings in components.
  • Translations must be natural and idiomatic — never use scripts or machine translation; treat quality the same as English copywriting.
  • SEO metadata, JSON-LD structured data, and sitemaps must all be locale-aware.
  • Default locale (English) uses clean URLs with no prefix (/products); other locales use a prefix (/es/products).

Supported Locales

Locale list lives in src/lib/i18n/locales.ts. Keep the sitemap script's locales array in sync with this file.

export const locales = ['en', 'es', 'fr', 'de', 'ja', 'zh-CN', /* ... add as needed */]
export const defaultLocale = 'en'
export type Locale = typeof locales[number]

Directory Structure

src/app/[lang]/
├── dictionaries/       ← One JSON file per locale
│   ├── en.json
│   ├── es.json
│   └── ...
├── dictionaries.ts     ← getDictionary(locale) server helper
├── layout.tsx          ← Root layout: generateMetadata + hreflang + JSON-LD
└── <page>/
    └── page.tsx        ← generateMetadata + page content

Translation Files

See references/translation-files.md for:

  • JSON key hierarchy conventions (page.section.key)
  • Server-side getDictionary() usage
  • Client-side useDictionary() hook usage
  • Template variable pattern ({count} substitution)
  • Fallback pattern for missing keys

Routing & Middleware

See references/routing.md for:

  • src/middleware.ts — locale detection, redirect /en/*/*, rewrite for default locale
  • LocalizedLink component — automatically prefixes non-default locales
  • useLocale() hook — reads locale from URL params → pathname → localStorage → default
  • getLocalizedPath() / removeLocalePrefix() utilities

SEO Metadata

See references/seo-metadata.md for:

  • generateMetadata() pattern in layout/page files
  • generateAlternatesMetadata() from src/lib/i18n/seo.ts
  • Full hreflang alternates.languages output (all locales + x-default)
  • OpenGraph locale / alternateLocale fields
  • html lang attribute and LangSetter client component

Structured JSON-LD Data

See references/structured-data.md for:

  • WebApplication schema with translated featureList, description
  • BlogPosting schema with inLanguage field
  • FAQ schema with translated acceptedAnswer
  • BreadcrumbList schema with localized URLs
  • Rendering via <Script> or <script> tags

Multi-language Sitemap

Metadata

Stars1947
Views1
Updated2026-03-04
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-javainthinking-web-i18n-nextjs": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.

Related Skills

2slides

AI-powered presentation generation using 2slides API. Create slides from text content, match reference image styles, or summarize documents into presentations. Use when users request to "create a presentation", "make slides", "generate a deck", "create slides from this content/document/image", or any presentation creation task. Supports theme selection, multiple languages, and both synchronous and asynchronous generation modes.

javainthinking 1947

powerdrill-data-analysis

This skill should be used when the user wants to analyze, explore, visualize, or query data using Powerdrill. Covers listing, creating, and deleting datasets; uploading local files as data sources; creating analysis sessions; running natural-language data analysis queries; and retrieving charts, tables, and insights. Triggers on requests like "analyze my data", "query my dataset", "upload this file for analysis", "list my datasets", "create a dataset", "visualize sales trends", "continue my previous analysis", "delete this dataset", or any data exploration task mentioning Powerdrill.

javainthinking 1947

powerdrill-data-analysis

This skill should be used when the user wants to analyze, explore, visualize, or query data using Powerdrill. Covers listing, creating, and deleting datasets; uploading local files as data sources; creating analysis sessions; running natural-language data analysis queries; and retrieving charts, tables, and insights. Triggers on requests like "analyze my data", "query my dataset", "upload this file for analysis", "list my datasets", "create a dataset", "visualize sales trends", "continue my previous analysis", "delete this dataset", or any data exploration task mentioning Powerdrill.

javainthinking 1947

apipick-ip-geolocation

Look up geographic location and network information for any IPv4 or IPv6 address using the apipick IP Geolocation API. Returns country, continent, city, latitude/longitude, timezone, currency, ISP, and ASN. Use when the user wants to geolocate an IP address, find the country or city for an IP, identify the ISP or ASN of an IP, look up timezone or currency for an IP, or check their own public IP location. Omit the IP parameter to look up the caller's own IP. Requires an apipick API key (x-api-key). Get a free key at https://www.apipick.com.

javainthinking 1947

2slides

AI-powered presentation generation using 2slides API. Create slides from text content, match reference image styles, or summarize documents into presentations. Use when users request to "create a presentation", "make slides", "generate a deck", "create slides from this content/document/image", or any presentation creation task. Supports theme selection, multiple languages, and both synchronous and asynchronous generation modes.

javainthinking 1947