Skip to content

How to set the default rendering language to English without using redirection? #1877

Closed
@zhangzhanling

Description

@zhangzhanling

Is your feature request related to a problem? Please describe.

I'm developing a multilingual project including Chinese, English and Russian, based on next14.2.4 and next-intl3.26.0. Currently, in page.js under the app directory, I redirect to the English project through redirect('/en'), and at this time, the URL path will display the 'en' identifier. However, I don't want the default 'en' identifier to be shown in the URL path; instead, I want the English project to be rendered by default. How should I set routing.ts? I saw on the official website that it is necessary to set localePrefix to 'as-needed', but it doesn't work. I would like to ask if this requirement is supported. How should I set it?

Describe the solution you'd like

I hope that by default, the English projects are rendered, but the URL does not show the "en" identifier.

Describe alternatives you've considered

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions