Skip to content

doom-9-zz/vue3-i18n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue3-i18n-plugin

How to use

npm i vue3-i18n-plugin --save

import App from "./App.vue";
import { createApp } from "vue";
import i18n from "vue3-i18n-plugin";

createApp(App)
  .use(i18n, {
    initial: "zh",
    translationConfiguration: {
      zh: {
        hello: "你好",
      },
      en: {
        hello: "hello",
      },
    },
  })
  .mount("#app");
<div>{{ $t('hello') }}</div>
import { changeLocal } from "vue3-i18n-plugin";

changeLocal("zh");

Releases

No releases published

Packages

No packages published