Skip to content

Commit

Permalink
feat(shared): leverage new getBestMatchingLocaleName function
Browse files Browse the repository at this point in the history
  • Loading branch information
lego-technix committed Oct 2, 2024
1 parent 0d7f35a commit 8d5ba84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shared/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ definePageMeta({
layout: 'empty',
});
const { localeCookie } = useLocaleCookie();
const { localeCookie, getBestMatchingLocaleName } = useLocaleCookie();
const locale = localeCookie.value;
onBeforeMount(() => {
const router = useRouter();
if (locale) {
return router.replace(`/${locale}/`);
return router.replace(`/${getBestMatchingLocaleName(locale)}/`);
}
});
</script>

0 comments on commit 8d5ba84

Please sign in to comment.