Support for regexp in Ignore localized routes
option
#1776
DaGLiMiOuX
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, guys.
First of all, great thanks for all your work and effort in this module. It really helps to simplify localization routes.
I've been working in my company website during this year updating it and doing some changes. All this work was made using Nuxtjs (I'm also working in the migration of the website to Nuxt3 in a separate project). Until now I've been using
target: server
in the project and configured our own cloud hosting to acceptnode
applications, but I'm kinda affraid that with the incoming changes of Nuxt3 I couldn't make it work, because I had to setup a starting point script in order to make it work properly usingexpress
to serve the website, so until I complete the migration and all required packages are stable too, I will keep working in our website with Nuxtjs v2 and Vue 2. I've been testing to changetarget: static
innuxt.config.js
in order to see if I can compile the whole site into a static one instead of serving it from a node server in case the upgrade to Nuxt3 forces me to stop using the starting point script or if our hosting could not serve it somehow. After correcting all thrown errors, I've noticed that a specific set of URL have been generated by thei18n
module when they should not, because they were configured in module settings to be excluded.After a whole day of searching and testing, I learned 2 things from ignoring routes in
@nuxtjs/i18n
:Ignore localized routes
, but when you read the docs page you can find that this setting relies in Vue filenames and not routes, which leads to confusion with link title.pages
setting does not accept regexp values (or atleast I couldn't make it work) and you have to write the exact Vue filename for each page you want to ignore in order to the module to find it. This is important, because I was trying to ignore a full subset of pages including the index one of that subset, which they have nothing to do with other languages, but for one. E.g.:I think that having the option to write it in regexp format like
'sub-page/*'
to ignore whole subset of pages or atleast recognizing folder names like'sub-page'
to exclude whole folder from other languages instead of writing each page of that subset one by one, will save users time and makingnuxt.config.js
more readable. In my case, there are 13 pages in that folder including index.I hope it is taken in count for a future option (or atleast for the Nuxt3 version).
Thanks for your time reading this.
Best regards,
D.
Beta Was this translation helpful? Give feedback.
All reactions