Getting started


We will be using ES2015 in the code samples in the guide.


<script src=""></script>
<script src=""></script>

<div id="app">
  <p>{{ $t("message.hello") }}</p>


// If using a module system (e.g. via vue-cli), import Vue and VueI18n and then call Vue.use(VueI18n).
// import Vue from 'vue'
// import VueI18n from 'vue-i18n'
// Vue.use(VueI18n)

// Ready translated locale messages
const messages = {
  en: {
    message: {
      hello: 'hello world'
  ja: {
    message: {
      hello: 'こんにちは、世界'

// Create VueI18n instance with options
const i18n = new VueI18n({
  locale: 'ja', // set locale
  messages, // set locale messages

// Create a Vue instance with `i18n` option
new Vue({ i18n }).$mount('#app')

// Now the app has started!

Output the following:

<div id="#app">
Last Updated: 2/5/2019, 11:35:51 PM