You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library is provided as utils specialized for i18n
What you are proposing is an API to get the non-locale part of the path.
That does not fit the policy of this library, but I would like to know more about why you want that API or not.
need for example on route middleware and parse url, where language doesn't matter, but the correct path is important:
exportdefaultdefineNuxtRouteMiddleware((to,from)=>{// beforeif(/\/\S{0,2}\/?landings\/?(.+)?/.test(to.path)){}// or using getLocalePathif(getPathLocale(to.path).baseName.replace(loc,'').startsWith('/landing/')){}// after - more safe and easy if(getPathWithoutLocale(to.path).startsWith('/landing/')){}// or maybe naming simple - getPath / getBasePath / getRawPath / parsePath ? })
Clear and concise description of the problem
need write regexp
like this
\/\S{0,2}\/?landings\/?(.+)?
- is simpleen
/fr
(but isen_US
?)Suggested solution
it would be convenient to parse h3 routers on the server for example function:
getPathWithoutLocale
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: