Static GitHub Issues

[1147] Non-redundant solution for i18n routing

prev: Include js library in nuxt.config.js with Assets
next: Route change prevented with beforeRouteUpdate still calls asyncData

Hello,

I'm looking for a clean way to produce routes with the following schema:

/:locale?/url1, /:locale?/url2, and /:locale? so my application can be reached at /url1 but also /fr/url1, ...

The example proposed in the documentation (https://nuxtjs.org/examples/i18n) is not convincing, as every page should be duplicated under _ lang, this is impossible for most applications with a lot of pages.

Using the extendRoutes is also non pertinent as we should duplicate all the routing inside the config file; using the filesystem to define routing would be consequently irrelevant (and I want to avoid two different approaches for the same thing).

Is there a solution to have the locale parameter being optional, whatever pages are added later?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1008">#c1008</a>)</em></sub></div>