Skip to content
Snippets Groups Projects
Commit 4d5f8d5c authored by Florent Lavelle's avatar Florent Lavelle
Browse files

router hotfix: add locale when not in url

parent 9d1d8a3c
No related branches found
No related tags found
No related merge requests found
Pipeline #11778 passed
......@@ -11,6 +11,9 @@ const routes = [
beforeEnter: (to, from, next) => {
const locale = to.params.locale;
const supported_locales = process.env.VUE_APP_I18N_SUPPORTED_LOCALE.split(',');
if (locale && !supported_locales.includes(locale) && locale.length !== 2) {
return next(`fr/${locale}`);
}
if (!supported_locales.includes(locale)) {
return next('fr');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment