๐ vue-cli-plugin-i18n
Vue CLI 3 plugin to add vue-i18n to your Vue Project
โญ Features
- vue-i18n basic scaffolding
- Locale messages in Single File components with vue-i18n-loader
- Env Variables
๐ Getting Started
If yon don't have a project created with Vue CLI 3:
vue create my-vue-app
Install the plugin into your project:
cd my-vue-app
vue add i18n
๐ Env variables
When vue-i18n code files had been scaffolded into your project, the following env variables generate into .env
:
-
VUE_APP_I18N_LOCALE
The locale of project localization, default
en
. -
VUE_APP_I18N_FALLBACK_LOCALE
The locale of project fallback localization, default
en
.
These env variables are read in src/i18n.(js|ts)
.
๐ง Configrations
vue-cli-plugin-i18n
have some plugin options in vue.config.js
:
module.exports = {
pluginOptions: {
i18n: {
locale: 'ja', // The locale of project localization
fallbackLocale: 'en', // The fallback locale of project localization
localeDir: 'locales', // The directory where store localization messages of project
enableInSFC: false // Enable locale messages in Single file components
}
}
}
See the prompts.js
.
๐ Changelog
Details changes for each release are documented in the CHANGELOG.md.
โ Issues
Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.
โ TODO
Managed with GitHub Projects
๐ช Contribution
Please make sure to read the Contributing Guide before making a pull request.