next-intl
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "next-intl" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-230eab0595bc0ff6fe3618fde328c4a1c87392d5f65f2ebd17cc41107fabb151. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Implement internationalization for Next.js applications using next-intl. Suitable for adding multilingual support, regional routing, date/number formatting, or translating UI content.
Introduction source: third_party · TerminalSkills · 1.0.0 Reference
SkillPi interpretation
- Testing
- Not tested
Browse files
Frontmatter
name: next-intl
description: >-
Internationalize Next.js apps with next-intl. Use when adding multi-language
support, locale routing, date/number formatting, or translating UI content.
license: Apache-2.0
compatibility: 'Next.js 13+ (App Router)'
metadata:
author: terminal-skills
version: 1.0.0
category: development
tags: [i18n, next-intl, nextjs, localization, internationalization]next-intl
Overview
next-intl is the leading i18n library for Next.js App Router. It handles locale routing, message translation, date/number formatting, and works with both server and client components. ICU message syntax for plurals and variables.
Instructions
Step 1: Setup
npm install next-intl
// i18n/request.ts — Locale detection
import { getRequestConfig } from 'next-intl/server'
export default getRequestConfig(async ({ requestLocale }) => {
const locale = await requestLocale || 'en'
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default,
}
})
// messages/en.json
{
"HomePage": {
"title": "Welcome to {appName}",
"description": "The best tool for {count, plural, one {# team} other {# teams}}",
"cta": "Get Started"
},
"Dashboard": {
"greeting": "Hello, {name}",
"lastLogin": "Last login: {date, date, medium}"
}
}
// messages/de.json
{
"HomePage": {
"title": "Willkommen bei {appName}",
"description": "Das beste Tool für {count, plural, one {# Team} other {# Teams}}",
"cta": "Jetzt starten"
}
}
Step 2: Server Components
// app/[locale]/page.tsx — Translated server component
import { useTranslations } from 'next-intl'
export default function HomePage() {
const t = useTranslations('HomePage')
return (
<main>
<h1>{t('title', { appName: 'MyApp' })}</h1>
<p>{t('description', { count: 5000 })}</p>
<a href="/signup">{t('cta')}</a>
</main>
)
}
Step 3: Middleware Routing
// middleware.ts — Locale routing
import createMiddleware from 'next-intl/middleware'
export default createMiddleware({
locales: ['en', 'de', 'fr', 'ja'],
defaultLocale: 'en',
localePrefix: 'as-needed', // /de/about but /about (for en)
})
export const config = { matcher: ['/((?!api|_next|.*\\..*).*)'] }
Guidelines
- ICU message syntax:
{count, plural, one {# item} other {# items}}for plurals. - Server components: use
useTranslations()directly, no context needed. - Client components: wrap with
NextIntlClientProvider. - Keep message keys namespaced by page/component for maintainability.
- Use
localePrefix: 'as-needed'to avoid /en/ prefix for default locale.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 Next.js 应用国际化的核心需求,提供完整的多语言支持方案
- 涵盖 locale routing、message translation、date/number formatting 等关键功能
- 适用于高频开发场景,具有广泛实用价值
Highlights
- 触发词精准完整,覆盖多种变体
- 边界清晰,明确适用于 Next.js 13+ App Router 环境
Highlights
- Phase/步骤清晰,有出口条件
- 含端到端示例,frontmatter完整
- 单文件≤500行,结构良好
Highlights
- 工具来源明确,参数正确
- 覆盖主要异常,不可逆操作有确认机制
- 提供完整的代码示例和配置说明
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 26
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.