import { boot } from "quasar/wrappers";
import { Cookies } from "quasar";
import { createI18n } from "vue-i18n";

import messages from "src/i18n";

const i18n = createI18n({
  locale: Cookies.get("locale")
    ? Cookies.get("locale")
    : window.navigator.language,

  globalInjection: true,
  messages,
});

export default boot(({ app }) => {
  app.use(i18n);
});

export { i18n };
