Gladiator Boo
Gladiator Boo

Reputation: 189

Vue3 + i18n-vue Override language detection?

I'm using vue3 with i18n-vue with language prefix. i18n-vue provides language detection (probably using browser language). How do I add custom detection?

eg) when a user hits /, i18n performs language detection, and routes to /en. this is good for most cases, except:

when a user is from a carrier X (hypothetically), instead of using i18n's language detection, i would like to override the default language to say, /es

Thanks

Upvotes: 0

Views: 84

Answers (1)

Gladiator Boo
Gladiator Boo

Reputation: 189

found the solution:

create middleware/redirect.global.ts, and redirect from it

Upvotes: 0

Related Questions