VUE with TYPESCRIPT
Manage Vue i18n with Typescript
Internationalize your Vue project thanks to vue-i18n along with Typescript
Your Vue project is running well for now. Greeeeat! 💥💥💥
All text is in English and it’s a good bet since you target all English speakers (a large part of the population). But it could be interesting to manage several languages to make your app world wide 🌐 and closer to your users 👩💻.
In this article, you will learn how to manipulate Vue i18n with Typescript. It’s a very handy and easy-to-use library to manage a multi-language app.
⚙ ️Setting things up
Installing vue-i18n starts with an npm command of course:
npm install vue-i18nyarn add vue-i18n #OR with yarnvue add i18n #OR with Vue CLI 3.x
Then in your main.ts file, you just need to add the following lines:
import Vue from 'vue'
import VueI18n…