Frequently Asked Questions

    Use Intlayer in Next.js Without [locale] in the Path

    Learn how to use Intlayer with Next.js without `[locale]` in the page path.

    Can I use an array as a content declaration?

    Yes: an array can be a content declaration in Intlayer. How to declare it, translate each item and read it back from your components.

    How to build dictionaries?

    When Intlayer builds dictionaries automatically, how to trigger a build manually with the CLI, and where the generated files are written.

    Fix Intlayer Build Errors in CI/CD

    Fix Server Components render errors that only happen in CI/CD builds, by making sure Intlayer dictionaries are built during the build step.

    I get module not found error when using bun

    Fix the "Cannot find package" error when running Intlayer with Bun, caused by how Bun scopes require(), with the configuration that solves it.

    Limit Claude Code Token Use When Translating

    Why translating with Claude Code burns tokens, what Intlayer does instead, and how to reuse your Claude subscription for translations.

    How to customize the locale list?

    Customize the list of locales Intlayer supports in intlayer.config.ts, including regional variants and the default locale.

    How to configure domain-based routing?

    Serve each locale from its own domain with Intlayer's domain-based routing, configured in intlayer.config.ts with redirects handled for you.

    vite-env-only: False node:fs Error with Intlayer

    Why vite-env-only reports a denied `node:fs` import with Intlayer + React-Router + Vite and what to do.

    Fix ESBuild Errors with Intlayer

    Fix ESBuild errors during an Intlayer build, usually caused by a missing or misconfigured bundler plugin for your framework.

    How to retrieve the locale from the cookies / headers?

    Read the current locale from cookies or request headers with Intlayer, on the server or in middleware, to render the right language.

    IntlayerNode type. What is it?

    What is it the IntlayerNode type? Why my string is transformed as an IntlayerNode<string>?

    Intlayer command undefined

    Fix the 'intlayer: command not found' error: install the CLI, run it through your package manager and check your PATH.

    Incorrect Locale Retrieved from URL

    Fix a wrong locale read from the URL in Next.js, such as "about" instead of "en", by using the [locale] folder structure Intlayer expects.

    I get an error related to sub-packages @intlayer/*

    Fix errors from mismatched @intlayer/* sub-package versions: align every Intlayer package to the same version and clear your lockfile cache.

    Static vs Dynamic Rendering with i18n in Next.js

    Why next-intl helpers turn Next.js i18n routes dynamic, and how to keep localized pages statically rendered.

    Can I translate the url path?

    Yes: Intlayer can translate URL paths, like /about to /fr/a-propos, with custom URL rewrites configured per locale.

    Fix the Intlayer 'Unknown Command' Error

    Fix the Intlayer CLI 'unknown command' error: check the command name, your CLI version and how you call the binary.