Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including vue-cli-plugin-i18n with all npm packages installed. Try it out:

var vueCliPluginI18n = require("vue-cli-plugin-i18n")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

vue-cli-plugin-i18n v0.6.0

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

:globe_with_meridians: 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

:star: Features

  • vue-i18n basic scaffolding
  • Locale messages in Single File components with vue-i18n-loader
  • Locale messages missing & unused reporting (experimental)
  • Env Variables

:rocket: 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

:hammer: 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.

:clipboard: 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).

:wrench: 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.

:scroll: Changelog

Details changes for each release are documented in the CHANGELOG.md.

:exclamation: Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

:white_check_mark: TODO

Managed with GitHub Projects

:muscle: Contribution

Please make sure to read the Contributing Guide before making a pull request.

:copyright: License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free