Receive notifications about upcoming Intlayer releases

    Is it possible to translate URLs?

    Yes! Intlayer supports custom URL rewrites, which allow you to define locale-specific paths. For example:

    bash
    en -> /productfr -> /fr/produites -> /es/producto

    To implement this, you can configure the routing section in your intlayer.config.ts file.

    For more information on how to implement this feature, see the Custom URL Rewrites documentation.

    You can also use the getMultilingualUrl and getLocalizedUrl functions to generate these URLs programmatically, and they will respect your rewrite rules.

    ts
    import { getLocalizedUrl, Locales } from "intlayer";const url = getLocalizedUrl("/product", Locales.FRENCH);console.log(url); // /fr/produit (if configured)