Using getLocaleFromRoute
from within defineNuxtRouteMiddleware
#3074
Unanswered
rudolfbyker
asked this question in
Q&A
Replies: 1 comment
-
+1, I need that myself. Currently I'm using a regex to extract the locale key from the route, but this will only work as long as the strategy stays the same. I'd like to have something that works reliably no matter what is configured. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to get a
getLocaleFromRoute
function within my custom Nuxt route middleware?This import will not work:
I don't just want the "current locale". Rather, I want a function that will reliably give me the locale, given an arbitrary route.
My current workaround is to re-implement
getLocaleFromRoute
myself.Beta Was this translation helpful? Give feedback.
All reactions