Skip to content

Instantly share code, notes, and snippets.

@Br0wnZ
Created December 2, 2022 09:06
Show Gist options
  • Save Br0wnZ/46bc86ed5dc08abf2896b17193df739e to your computer and use it in GitHub Desktop.
Save Br0wnZ/46bc86ed5dc08abf2896b17193df739e to your computer and use it in GitHub Desktop.
i18n for Vue 3 with Composition API
import { createApp } from "vue";
import { createI18n } from "vue-i18n";
import App from "./App.vue";
import messages from "@intlify/unplugin-vue-i18n/messages";
const i18n = createI18n({
legacy: false,
globalInjection: true,
locale: "es",
fallbackLocale: "es",
availableLocales: ["es", "en"],
messages: messages,
});
const app = createApp(App)
app.use(i18n)
app.mount('#app')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment