<template>
  <router-view />
</template>

<script setup>
import { Cookies } from "quasar";
import { watch } from "vue";
import { useI18n } from "vue-i18n";

defineOptions({
  name: "App",
});

const { locale } = useI18n();

const localeCookie = Cookies.get("locale") || window.navigator.language;
locale.value = localeCookie;

watch(
  () => locale.value,
  (value) => {
    Cookies.set("locale", value, {
      expires: 365,
      path: "/",
    });
  },
);
</script>
