vue-i18n Setup and Message Files
createI18n(), locale JSON files, message syntax {name}, nested keys, fallback locale.
What Is i18n?
Internationalization (i18n) is building your app so it can present text in multiple languages. Vue I18n is the official-style library for translating Vue apps.
Instead of hardcoding English strings, you look up keys that resolve to the active language.
Installing Vue I18n
Add the package. For Vue 3 you use version 9 or later, which is built around the Composition API.
// terminal
// npm install vue-i18nAll lessons in this course
- vue-i18n Setup and Message Files
- useI18n Composable and t() Function
- Pluralization and Linked Messages
- Number, Date, and Currency Formatting