moxystudio/next-intl

Add pathname / subfolder policy

Closed this issue · 2 comments

This policy would match against pathnames that start with locales, such as /pt/about.

Things to consider:

  • Perhaps it would be nice to have slug property in locales that policies such as this one could use (e.g.: to make prettier URLs).
  • Will probably require us to have a custom <Link> component.
  • The act method of this policy would listen to URL changes to check if the pathname need to be corrected with replaceState.
Axiol commented

What is the status on that? I see the code is merged. Is it working? Some doc somewhere on that?

@moxy/next-intl v3 was released, which embraces the new Next.js i18n capabilities, meaining subfolders are now supported by Next.js itself.