add-locale-url-prefix

Restore locale-prefixed routing and navigation in a Next.js 16 app with next-intl.

45|12|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/vercel/shop --skill add-locale-url-prefix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-locale-url-prefix
Source: https://github.com/vercel/shop/tree/main/packages/plugin/skills/add-locale-url-prefix
Command: npx skills add https://github.com/vercel/shop --skill add-locale-url-prefix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Restoring locale-prefixed URLs and next-intl routing in the shop template to re-enable multi-language navigation and locale-aware content delivery.

Core Features & Use Cases

  • Recreate routing and navigation files for Next.js app with locale prefixes and next-intl routing.
  • Move routes back under app/[locale]/ to restore per-locale page structure and generateStaticParams for available locales.
  • Restore locale utilities and middleware (lib/i18n/routing.ts, navigation.ts, getLocale, request config, proxy middleware) to load locale-specific messages and ensure correct URL rewrites.
  • Update SEO, sitemap, and redirects to preserve per-locale canonical URLs and language alternates.
  • Use cases include multi-language storefronts where URLs reflect locale, and dynamic locale switching via the megamenu locale selector.

Quick Start

Recreate the locale routing setup and move routes under app/[locale]/ to restore locale-aware navigation across the shop template.

Frequently Asked Questions about add-locale-url-prefix

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

FAQPage Schema
How do I restore locale-prefixed routing in a Next.js app router project?

Restoring locale-prefixed routing involves moving routes under app/[locale]/, recreating navigation utilities, and restoring middleware to re-enable multi-language URL structure with next-intl.

What is the best way to structure Next.js routes for multi-language storefronts?

The best way to structure multi-language storefronts is placing routes under app/[locale]/ and using next-intl utilities to generate static params for locales like en-US and de-DE.

Does next-intl work with the Next.js app router for locale-aware URLs?

Yes, next-intl works with the app router by utilizing routing.ts and navigation.ts files to load locale-specific messages and ensure correct URL rewrites for locale-aware URLs.

How do I update SEO and sitemaps when adding locale prefixes to Next.js URLs?

Update SEO and sitemaps when adding locale prefixes by restoring per-locale canonical URLs and language alternates, ensuring sitemap entries reflect the locale structure correctly.

Why did my Next.js shop template lose multi-language navigation after an upgrade?

Multi-language navigation breaks when routes are moved out of app/[locale]/ or middleware is removed, requiring the recreation of i18n helpers to load locale-specific messages properly.

Can I use dynamic locale switching in a Next.js shop template with next-intl?

Yes, dynamic locale switching is supported by restoring locale utilities and middleware, allowing the megamenu locale selector to switch between languages like fr-FR and nl-NL seamlessly.