import { defineBoot } from "#q-app/wrappers";
import { createI18n } from "vue-i18n";
import { Cookies } from "quasar";
import messages from "src/i18n";

const i18n = createI18n({
  locale: Cookies.get("locale") ? Cookies.get("locale") : "pt-BR",
  globalInjection: true,
  legacy: false,
  messages,
});

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

export { i18n };
