Created
December 2, 2022 09:06
-
-
Save Br0wnZ/46bc86ed5dc08abf2896b17193df739e to your computer and use it in GitHub Desktop.
i18n for Vue 3 with Composition API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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