fluent-vue

Internationalization plugin for Vue.js

README

SWUbanner

fluent-vue logo

  Internationalization plugin for Vue.js

GitHub Workflow Status codecov npm bundle size Standard - JavaScript Style Guide GitHub license


fluent-vue is a Vue.js integration for Fluent.js - JavaScript implementation of Mozilla's Project Fluent

🚀 Features


- Simple api for developers: Just 2 methods, 1 directive and 1 component
- Powerfull syntax for translators: Use the entire expressive power of every language without need for changes to application source code
- Isolation: Locale-specific logic doesn't leak to other locales. A simple string in English can map to a complex multi-variant translation in another language
- Seamless migration: Works for both Vue 3 and 2
- No bundler required: Usable via CDN

🎉 Example


  1. ```vue
  2. <template>
  3.   <div>
  4.     <div>{{ $t('hello-user', { userName }) }}</div>
  5.     <div>{{ $t('shared-photos', { userName, photoCount, userGender }) }}</div>
  6.   </div>
  7. </template>
  8. <fluent locale="en">
  9. # Simple things are simple.
  10. hello-user = Hello, {$userName}!

  11. # Complex things are possible.
  12. shared-photos =
  13.   {$userName} {$photoCount ->
  14.      [one] added one photo
  15.     *[other] added {$photoCount} new photos
  16.   } to {$userGender ->
  17.      [male] his stream
  18.      [female] her stream
  19.     *[other] their stream
  20.   }.
  21. </fluent>
  22. ```

📖 Documentation


Documentation can be found here: https://fluent-vue.demivan.me

Examples for different Vue.js versions and build systems can be found here.

📜 Changelog


Changes for each release are documented in the CHANGELOG.md.

📦 Packages


ProjectNPMRepo
--------------
fluent-vue[![fluent-vue](https://img.shields.io/npm/v/fluent-vue.svg)](https://www.npmjs.com/package/fluent-vue)[fluent-vue/fluent-vue](https://github.com/fluent-vue/fluent-vue)
unplugin-fluent-vue[![unplugin-fluent-vue](https://img.shields.io/npm/v/unplugin-fluent-vue.svg)](https://www.npmjs.com/package/unplugin-fluent-vue)[fluent-vue/unplugin-fluent-vue](https://github.com/fluent-vue/unplugin-fluent-vue)
Webpack[![fluent-vue-loader](https://img.shields.io/npm/v/fluent-vue-loader.svg)](https://www.npmjs.com/package/fluent-vue-loader)[fluent-vue/fluent-vue-loader](https://github.com/fluent-vue/fluent-vue-loader)
Rollup/Vite[![frollup-plugin-fluent-vue](https://img.shields.io/npm/v/rollup-plugin-fluent-vue.svg)](https://www.npmjs.com/package/rollup-plugin-fluent-vue)[fluent-vue/rollup-plugin-fluent-vue](https://github.com/fluent-vue/rollup-plugin-fluent-vue)

📄 License


MIT License © 2020-present Ivan Demchuk