0

I'm planning a project on Nuxt.js, but at the moment I can't find an elegant solution for the regions functionality. I would be very grateful for an idea that will help you implement the functionality in which the prefix of the selected region was added to the URLs.Example:


https://example.net/.../ - default region (EU region)


https://example.net/eu/.../ - EU region


https://example.net/au/.../ - AU region


Something similar is done by nuxt/i18n, but the problem is that each region can have several languages. At the moment, there is only one idea - to do this via NGINX, but I'm not sure yet whether it will work (take each url with the region prefix and proxy it to localhost: 3000 as an example). I don't ask you to write the code for yourself, I just need advice on which way to go. If you have any ideas, I would be very grateful.

lna1989
  • 1
  • 1
  • Well, the first idea that pops in my mind would be use the regions as locale, and use a second parameter as the language for the locale. But then you would have a big bundle of text for all languages for each region, which isn't good for the long term... – Giovane Nov 25 '20 at 01:15
  • The second idea I had was try to "hack" the nuxt-i18n and register the codes like: eu/en, eu/es, eu/fr... But the index page crashed when using the default locale, without any region/locale – Giovane Nov 25 '20 at 01:16
  • @Giovane As a result, did you manage to solve this problem in your project? At the moment, I found the code in nuxt-i18n responsible for expanding routes for each locale, I think based on it to write a new module that will expand the router for each store without duplicating components in the pages folder. – lna1989 Dec 10 '20 at 18:01

0 Answers0