-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request getPathWithoutLocale #30
Comments
Thank you for your feedback! This library is provided as utils specialized for i18n |
BTW, |
need for example on route middleware and parse url, where language doesn't matter, but the correct path is important: export default defineNuxtRouteMiddleware((to, from) => {
// before
if (/\/\S{0,2}\/?landings\/?(.+)?/.test(to.path)) {}
// or using getLocalePath
if(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: