Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/abes-esr/theses-front in…
Browse files Browse the repository at this point in the history
…to test
  • Loading branch information
clementdelafontaine committed Dec 17, 2024
2 parents e9c4a2f + 912d65e commit 716c936
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/common/HeaderCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ onMounted(() => {
lang: locale.value,
},
})
} else {
locale.value = "fr";
localStorage.setItem("language", locale.value);
}
});
Expand Down
15 changes: 15 additions & 0 deletions components/common/HeaderMobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ onBeforeMount(() => {
isReady.value = true;
});
onMounted(() => {
if (localStorage.getItem("language")) {
locale.value = localStorage.getItem("language");
useHead({
htmlAttrs: {
lang: locale.value,
},
})
} else {
locale.value = "fr";
localStorage.setItem("language", locale.value);
}
});
const props = defineProps({
type: {
type: String,
Expand Down
5 changes: 4 additions & 1 deletion pages/apropos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { useRouter } from "nuxt/app";
const router = useRouter();
onMounted(() => {
router.push(localStorage.getItem("language") + '/apropos');
router.push(
localStorage.getItem("language")
? localStorage.getItem("language") + '/apropos'
: '/fr/apropos');
}
);
</script>

0 comments on commit 716c936

Please sign in to comment.