i18n-best-practices

Enforce i18n best practices for Next.js projects using next-intl.

2|Updated Apr 9, 2023
One-click install
npx skills add https://github.com/Esdeveniments/esdeveniments-frontend --skill i18n-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n-best-practices
Source: https://github.com/Esdeveniments/esdeveniments-frontend/tree/main/.github/skills/i18n-best-practices
Command: npx skills add https://github.com/Esdeveniments/esdeveniments-frontend --skill i18n-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to implementing internationalization in Next.js projects using next-intl, ensuring consistent locale handling, accurate navigation, and SEO-friendly URLs.

Core Features & Use Cases

  • Enforces using Link from @i18n/routing for internal navigation to preserve locale prefixes.
  • Guides translation management across locales (ca, es, en) and how to structure messages.
  • Provides patterns for localized JSON-LD URLs and breadcrumbs.

Quick Start

Use this skill to validate that internal links always preserve the locale and that JSON-LD URLs are localized with toLocalizedUrl.

Frequently Asked Questions about i18n-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve locale prefixes in Next.js internal navigation?

To preserve locale prefixes in Next.js navigation, use the Link component from @i18n/routing instead of standard links. This ensures consistent locale handling and prevents broken navigation when users switch between localized URLs.

What's the best way to localize JSON-LD URLs for SEO in Next.js?

The best way to localize JSON-LD URLs is by applying the toLocalizedUrl function to your structured data. This ensures search engines receive accurate, locale-specific URLs for breadcrumbs and other JSON-LD data in your multilingual project.

How do I structure translation messages across multiple locales with next-intl?

Structure translation messages by organizing JSON files for each locale like ca, es, and en. This skill guides translation management across locales to maintain consistent message keys and ensure accurate content delivery.

Why does my next-intl routing break when switching locales?

Your next-intl routing breaks when switching locales if internal links do not preserve the locale prefix. Enforcing best practices for internationalization routing ensures consistent locale handling and prevents broken navigation.

Does this i18n routing approach work with localized URLs and SEO requirements?

Yes, this internationalization approach works with localized URLs and SEO requirements. It provides patterns for localized JSON-LD URLs and enforces locale-prefixed internal navigation to maintain accurate multilingual routing.