I got it working by changing the i18n.js file like this
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n);
const messages = {
'en': {
"test": "Test",
"store": {
"new_products": "New Products",
"add_to_cart": "Add to Cart",
"categories": "Categories",
"search": "Search here",
"most_recent": "Most Recent",
"price_high_low": "Price: high to low",
"price_low_high": "Price: low to high"
},
"header": {
"my_account": "My Account",
"my_cart": "My Cart"
},
"menu": {
"store": "Store",
"inventory": "Inventory",
"sales": "Sales",
"categories": "Categories",
"products": "Products",
"users": "Users",
"about_us": "About Us"
}
},
'es': {
"test": "Prueba",
"store": {
"new_products": "Productos Nuevo",
"add_to_cart": "Agregar al Carrito",
"categories": "Categorias",
"search": "Buscar aqui",
"most_recent": "Más Recientes",
"price_high_low": "Precio: alto a bajo",
"price_low_high": "Precio: bajo a alto"
},
"header": {
"my_account": "Mi Cuente",
"my_cart": "Mi Carrito"
},
"menu": {
"store": "Tienda",
"inventory": "Inventario",
"sales": "Ventas",
"categories": "Categorias",
"products": "Productos",
"users": "Usuarios",
"about_us": "Quienes Somos"
}
}
}
const i18n = new VueI18n({
locale: 'es',
fallbackLocale: 'es',
messages: messages
});
export default i18n
Also adding i18n to the new Vue