이 페이지와 원하는 AI 어시스턴트를 사용하여 문서를 요약합니다
버전 기록
- "Init history"v9.0.02026. 6. 13.
이 페이지의 콘텐츠는 AI를 사용하여 번역되었습니다.
영어 원본 내용의 최신 버전을 보기If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Migrate from next-intl to Intlayer
For a complete and detailed step-by-step tutorial, please see our full next-intl Migration Guide.
Migrating from next-intl to Intlayer allows you to maintain your application routing and syntax completely undisturbed.
What to do
Execute the following command in your repository:
코드를 클립보드에 복사
npx intlayer initThis will create an intlayer.config.ts. In your next.config.ts, use the plugin wrapper to seamlessly inject the next-intl aliases towards @intlayer/next-intl.
코드를 클립보드에 복사
import type { NextConfig } from "next";import { createNextIntlPlugin } from "@intlayer/next-intl/plugin";const withIntlayer = createNextIntlPlugin();const nextConfig: NextConfig = {};export default withIntlayer(nextConfig);What it does under the hood
The bundler wrapper replaces translations, but leaves the next-intl/navigation features intact (e.g. Link, redirect, usePathname).
Under the hood:
- ICU runtime: Plurals (
=0,one,other), select/selectordinal,#arguments, and formatted args ({ts, date, long}) run correctly using the sharedresolveMessage(..., 'icu')resolver. useTranslations()&getTranslations(): The bare scope calls extract the first key segment as the correct dictionary identifier. Nested namespaces gracefully split into dictionary paths and prefixes.- Rich formatting: Both
t.rich()andt.markup()are fully natively implemented, converting HTML-like nodes into rendered React chunks. useFormatter:relativeTime,list,dateTimeRange, and named formats from the configuration bridge to the core nativeIntlformatters.