Open-source project
amannn/next-intl avatar
amannn/next-intl

next-intl puts locale in the URL and ICU syntax in the call

🌐 Internationalization (i18n) for Next.js

4,392 stars398 forksTypeScriptMIT

At a glance

What is it?
A look at how next-intl handles routing, message formatting and type safety inside a Next.js app, and where its single-hook design costs you. MIT licensed, last push 2026-10-02.
Who is it for?
Adopt next-intl when the product already runs on Next.js, the locale has to be part of the pathname, and translators are willing to edit ICU message strings directly. The deal is favorable for an App Router codebase that has not yet fixed its translation stack.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • amannn/next-intl4,392 ★ · +18
Star history
Repository2026-09-232026-11-25
amannn/next-intl4.4k4.4k

18 Stars in the last 63 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Locale lives in the pathname, not in a provider tree

Most React i18n libraries leave routing to you and hand back a translation function. next-intl takes the URL as part of its contract: each language gets its own path prefix, and pathnames can be localized for search engines as well. That decision is why an example called example-app-router-without-i18n-routing sits next to example-app-router in the repository, and why a separate example-pages-router-legacy exists. The App Router path treats routing as the default, with a dedicated example for opting out of it.

That inversion has consequences for the rest of your code. Once the locale is a route segment, a page component never has to guess which language to render, and server components can be statically rendered per locale.

ICU messages instead of string concatenation

The README's profile example is the clearest statement of intent. A message key such as UserProfile.followers takes a full ICU plural expression with =0, =1 and other branches, and membership formats a date inline with the memberSince placeholder and a short date style. Interpolation, cardinal and ordinal plurals, enum-based label selection and rich text all live inside the message string itself rather than in branching code.

This is a real difference from the concatenation style, and it moves grammar decisions into the translator's hands. It also makes drift detectable, because the placeholders inside a message can be compared across locales. The rule to check first is whether your translators are comfortable editing ICU syntax, because the same grammar that fixes plural agreement makes the message file harder to review by eye.

One hook, message keys checked at compile time

Every component in the README example does the same three things: import useTranslations from next-intl, call it with a namespace such as UserProfile, and pass keys plus values. Autocompletion for message keys and compile-time checks against typos are the stated payoff, which works because keys are plain string literals in the call rather than variables assembled at runtime.

The whole call fits in one import and one line of setup per component:

jsx
import {useTranslations} from 'next-intl';

export default function UserProfile({user}) {
  const t = useTranslations('UserProfile');
}

The messages the keys point at live in a plain JSON namespace with the same name:

json
{
  "UserProfile": {
    "title": "{firstName}'s profile"
  }
}

That is a trade against dynamic keys. Code that builds a key from a variable loses the compile-time guarantee and the autocompletion at once, so a table-driven interface may end up going through a small hand-written wrapper instead. Check your own code for computed keys before adopting, since that pattern is where the type safety quietly stops applying. The rest of the API is hooks-based, so the same import style carries across your code base.

The README sends you to next-intl.dev for setup

There is no install command anywhere in the README. Installation lives entirely on the documentation site, which the README links under its features list, so a reader looking for a copy-paste first step finds a features list and a docs link instead. Expect to pick up the setup command, the request configuration and the routing conventions from the site rather than from the repository.

The repository itself documents how the library is worked on rather than how it is consumed. The root package.json is private, names itself root, pins packageManager to [email protected] and wires turbo to build the packages under packages/ and lerna-lite to publish them. None of those scripts install next-intl into an application. If you want a working starting point without reading the docs first, the examples directory is the place to look: it holds separate apps for the App Router, the Pages Router, an extracted variant, a migration path, a playground and a minimal use-intl example.

eloqnt lint exists because message files rot

The README names a specific failure rather than a vague risk: as an app grows, messages drift and become inconsistent. A German title can end up without the {firstName} placeholder the English one requires, and a key can exist with no German translation at all. The CLI output in the README shows both, flagged as inconsistent-args and missing-translation.

Two details are worth reading closely. The missing-translation finding is raised in messages/de.json on an entry that still holds the English membership string, not on an empty slot. And the tool can fill gaps with eloqnt translate, using your source code as context. This is a companion tool under a separate name and its own documentation, so it is not something next-intl itself runs for you.

Dates and numbers hide the server and client split

The features list claims date, time and number formatting without worrying about server and client differences such as time zones. The mechanism behind that claim is visible in the example rather than spelled out: the memberSince value is a real date passed straight into a message with a date style, with no formatter configured in the component. Whichever locale is in play for that render, the style comes from the message.

The catch is that a component rendering differently on the server than in the browser is a hydration bug, and the library is absorbing that decision for you. If you need a date rendered in the reader's own zone rather than the active locale, that is the point at which you stop relying on the message and format the value yourself. The README does not document a per-value override, so check that case against the docs before you design around it.

How next-intl differs from i18next and react-intl

i18next is a framework-agnostic translation core that ships with adapters, and react-intl wraps the FormatJS implementation for React. Both leave the URL to your own routing. next-intl's approach is the reverse: routing and message formatting arrive as one package built around Next.js, so the locale-in-pathname decision, the routing helpers and the ICU formatter are welded together.

That coupling is what you are buying and what you are giving up. You get App Router and Server Component support with static rendering rather than assembling providers yourself. You also inherit a dependency on Next.js conventions, which is why the examples directory carries a legacy Pages Router app alongside the App Router ones. For a codebase that is already Next.js and already lives in URLs, that trade is usually easy. For a shared React application or a framework that is not Next.js, it is not a choice at all.

Editorial conclusion

Adopt next-intl when the product already runs on Next.js, the locale has to be part of the pathname, and translators are willing to edit ICU message strings directly. The deal is favorable for an App Router codebase that has not yet fixed its translation stack. Skip it for a shared React application, for a Pages Router codebase heading toward a migration you have not scheduled, or for a team that already standardizes on i18next or react-intl and would rather keep one message pipeline. Verify three things before committing: whether your code builds any message keys from variables, which would give up compile-time checks, whether dates must render in the reader's zone rather than the active locale, and whether the routing entry point at next-intl.dev matches the App Router version you are on.

Frequently asked questions

How do I install next-intl?

The README gives no install command of its own. It points to the documentation site at next-intl.dev for setup, and the repository examples directory holds runnable App Router and Pages Router applications you can read instead.

What is next-intl?

An internationalization library for Next.js. It provides ICU message syntax, date, time and number formatting, type-safe message keys, a hooks-based API and internationalized routing with localized pathnames.

How do I use next-intl in a component?

Import useTranslations from next-intl, call it with a namespace such as UserProfile, then pass a message key and its values. The key is a plain string literal, which is what gives you autocompletion and compile-time typo checks.

When does next-intl break?

The README does not document a failure mode directly. The one named risk is message drift, where messages become inconsistent as an app grows, which the companion tool eloqnt lint is built to catch.

How does next-intl compare to i18next?

i18next is a framework-agnostic translation core that relies on adapters, while next-intl bundles routing into the package and ties message formatting to Next.js conventions. next-intl gives you locale-in-pathname routing out of the box at the cost of depending on Next.js.

Does next-intl have a VS Code extension?

The README does not mention a VS Code extension. It describes type-safe message keys with autocompletion and compile-time checks as part of the library itself.

Official sources

  1. amannn/next-intl on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/amannn-next-intl.svg)](https://hysenlabs.com/projects/amannn-next-intl)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/amannn-next-intl.svg)](https://hysenlabs.com/projects/amannn-next-intl)

Was this useful?