npm

Need private packages and team management tools?Check out npm Orgs. »

vue-cli-plugin-i18n

0.6.0 • Public • Published

🌐 vue-cli-plugin-i18n

npm CircleCI vue-cli-plugin-i18n Dev Token

Vue CLI 3 plugin to add vue-i18n to your Vue Project

Become a Patreon

⭐️ Features

  • vue-i18n basic scaffolding
  • Locale messages in Single File components with vue-i18n-loader
  • Locale messages missing & unused reporting (experimental)
  • 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

🔨 Injected Commands

  • vue-cli-service i18n:report (experimental)

    Report the missing locale message keys and unused keys.

NOTE: limitation vue-cli-service i18n:report cannot detect missing and unused keys from local messages of i18n custom blocks.

📋 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.

©️ License

MIT

install

npm i vue-cli-plugin-i18n

Downloadsweekly downloads

14,811

version

0.6.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability