Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]: Pages Router - is it possible to localize pathnames / can you provide an example #1425

Closed
Gieryneck opened this issue Oct 16, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation unconfirmed Needs triage.

Comments

@Gieryneck
Copy link

Link to page

https://next-intl-docs.vercel.app/examples

Describe the problem

I'm trying to localize pathnames (as in https://next-intl-docs.vercel.app/docs/routing#pathnames) with next-intl in a next 13.3.1 that uses Pages Router but can't seem to get it working. Is it possible to do that? if yes, could you provide an example for that use case? if no, could you update the docs to specifically mention a limitation in that regard?

@Gieryneck Gieryneck added documentation Improvements or additions to documentation unconfirmed Needs triage. labels Oct 16, 2024
@amannn
Copy link
Owner

amannn commented Oct 16, 2024

Maybe the App Router Migration example could provide a base for this as it shows how the i18n routing functionality of next-intl can be used with the Pages Router. Hope that helps!

@amannn amannn closed this as completed Oct 16, 2024
@Gieryneck
Copy link
Author

Gieryneck commented Oct 22, 2024

if anyone is curious, looks like it's "kind of" possible https://github.com/Gieryneck/pages-router-next-intl-poc but since the i18n is removed from next.config the locale must be taken from the url path (the localePrefix cannot be 'never'). And I don't see a way of getting locale on _error.tsx page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants