vue-i18n

Vue I18n for Vue 3

MIT License

Downloads
19.2M
Stars
2.1K

Bot releases are visible (Hide)

vue-i18n - v9.4.1

Published by github-actions[bot] about 1 year ago

What's Changed

🐛 Bug Fixes

📝️ Documentations

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.4.0...v9.4.1

vue-i18n - v9.4.0

Published by github-actions[bot] about 1 year ago

What's Changed

🌟 Features

🐛 Bug Fixes

⚡ Improvement Features

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0...v9.4.0

vue-i18n - v9.3.0

Published by github-actions[bot] about 1 year ago

We are excited to announce the release of Vue I18n v9.3, finally !! This release includes some new features, bug fixes, improvements, and document fixes.

We had commited with 37 contributors. Thanks for your contributing ❤️

In the following, we introduce some of the new features:

🌟 Features

Node.js Dual packages (cjs / mjs)

We provide CommonJS and Native ESM dual module packages for Node.js. This supports both require and import for loading modules in Node.js.

JIT Style Compilation

Supports JIT (Just In Time) style compilation of message formats. This mean, removes the CSP limitation and allows for use in environments such as Service worker, Web worker, and Edge.

It mean also now supports the use-case where locale messages are dynamically retrieved from the backend via the API.

For more information, please see the docs

The performance of JIT-style compilation is close to that of conventional AOT (Ahead Of Time) style compilation, and you can improve the performance to nearly 3x with combination of JIT + AOT.

Below are the compile performance benchmark results for vue-i18n:

> node ./benchmark/index.mjs

compilation:

compile simple message x 396,898 ops/sec ±0.31% (98 runs sampled)
compile complex message x 60,036 ops/sec ±0.34% (99 runs sampled)

simple pattern on 1000 resources (AOT):

resolve time with core x 279,919 ops/sec ±0.19% (99 runs sampled)
resolve time on composition x 93,963 ops/sec ±0.48% (93 runs sampled)
resolve time on composition with compile cache x 230,928 ops/sec ±0.20% (100 runs sampled)

simple pattern on 1000 resources (JIT):

resolve time with core x 277,813 ops/sec ±0.18% (99 runs sampled)
resolve time on composition x 91,959 ops/sec ±0.43% (97 runs sampled)
resolve time on composition with compile cache x 227,117 ops/sec ±0.15% (99 runs sampled)

simple pattern on 1000 resources (JIT + AOT):

resolve time with core x 319,061 ops/sec ±0.18% (100 runs sampled)
resolve time on composition x 204,529 ops/sec ±0.22% (95 runs sampled)
resolve time on composition with compile cache x 204,652 ops/sec ±0.30% (100 runs sampled)

complex pattern on 1000 resources (AOT):

resolve time with core x 240,427 ops/sec ±0.37% (100 runs sampled)
resolve time on composition x 33,959 ops/sec ±0.45% (94 runs sampled)
resolve time on composition with compile cache x 200,980 ops/sec ±0.15% (99 runs sampled)

complex pattern on 1000 resources (JIT):

resolve time with core x 225,739 ops/sec ±0.25% (99 runs sampled)
resolve time on composition x 36,379 ops/sec ±0.49% (97 runs sampled)
resolve time on composition with compile cache x 191,653 ops/sec ±0.24% (100 runs sampled)

complex pattern on 1000 resources (JIT + AOT):

resolve time with core x 278,542 ops/sec ±0.20% (98 runs sampled)
resolve time on composition x 92,781 ops/sec ±0.31% (98 runs sampled)
resolve time on composition with compile cache x 92,865 ops/sec ±0.33% (98 runs sampled)

You can clone Vue I18n and run the benchmark with pnpm build:type && pnpm benchmark to check.

Custome message format

Starting with v9.3, Vue I18n will give message format customization as an experimental feature. This will allow for extending to the message format:

import { createI18n } from 'vue-i18n'
import { messageCompiler } from './compilation'

const i18n = createI18n({
  legacy: false,
  locale: 'en',
  messageCompiler,
  messages: {
    en: {
      hello: 'hello world!',
      greeting: 'hi, {name}!',
      photo: `You have {numPhotos, plural,
        =0 {no photos.}
        =1 {one photo.}
        other {# photos.}
      }`
    }
  }
})

About details, please see the docs

Exports type definition and API

Export v-t type definitions and API $te to support Vue I18n extending for third vendors and your Vue applications.

❗ Important Changes: 1

allowComposition option

The allowComposition option will be removed in Vue I18n v10. We have accordingly output a warning if you are using it.

If you are using Vue I18n Legacy API to migrate to the Composition API, please make sure you have done so with the Vue I18n v9 version.

Deprecate vue-i18n official bundle plugins

The following plugin or loader for bundler is deprecated because it can be replaced by the unplugin-vue-i18n.

These will only be taken as hot fixes in the future, and no additional functionality will be added.

⚡ Improvement Features: 15

🐛 Bug Fixes: 17

📝️ Documentations: 28

🧑‍🤝‍🧑 Contributers: 37

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.2.2...v9.3.0

vue-i18n - v9.3.0-beta.27

Published by github-actions[bot] about 1 year ago

What's Changed

🌟 Features

🐛 Bug Fixes

📝️ Documentations

👕 Refactoring

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.26...v9.3.0-beta.27

vue-i18n - v9.3.0-beta.26

Published by github-actions[bot] about 1 year ago

What's Changed

⚡ Improvement Features

📝️ Documentations

👕 Refactoring

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.25...v9.3.0-beta.26

vue-i18n - v9.3.0-beta.25

Published by github-actions[bot] about 1 year ago

What's Changed

🌟 Features

🐛 Bug Fixes

📝️ Documentations

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.24...v9.3.0-beta.25

vue-i18n - v9.3.0-beta.24

Published by github-actions[bot] over 1 year ago

What's Changed

🐛 Bug Fixes

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.23...v9.3.0-beta.24

vue-i18n - v9.3.0-beta.23

Published by github-actions[bot] over 1 year ago

What's Changed

🌟 Features

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.22...v9.3.0-beta.23

vue-i18n - v9.3.0-beta.22

Published by github-actions[bot] over 1 year ago

What's Changed

🐛 Bug Fixes

📈 Performance Fixes

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.21...v9.3.0-beta.22

vue-i18n - v9.3.0-beta.21

Published by github-actions[bot] over 1 year ago

What's Changed

🐛 Bug Fixes

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.20...v9.3.0-beta.21

vue-i18n - v9.3.0-beta.20

Published by github-actions[bot] over 1 year ago

What's Changed

🌟 Features

🐛 Bug Fixes

📈 Performance Fixes

📝️ Documentations

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.19...v9.3.0-beta.20

vue-i18n - v9.3.0-beta.19

Published by github-actions[bot] over 1 year ago

What's Changed

🐛 Bug Fixes

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.18...v9.3.0-beta.19

vue-i18n - v9.3.0-beta.18

Published by github-actions[bot] over 1 year ago

What's Changed

🌟 Features

🐛 Bug Fixes

⚡ Improvement Features

📝️ Documentations

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.17...v9.3.0-beta.18

vue-i18n - v9.3.0-beta.17

Published by github-actions[bot] over 1 year ago

What's Changed

🌟 Features

⚡ Improvement Features

📝️ Documentations

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.16...v9.3.0-beta.17

vue-i18n - v9.3.0-beta.16

Published by github-actions[bot] almost 2 years ago

What's Changed

⚡ Improvement Features

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.15...v9.3.0-beta.16

vue-i18n - v9.3.0-beta.15

Published by github-actions[bot] almost 2 years ago

What's Changed

🐛 Bug Fixes

⚡ Improvement Features

📝️ Documentations

New Contributors

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.14...v9.3.0-beta.15

vue-i18n - v9.3.0-beta.14

Published by github-actions[bot] almost 2 years ago

What's Changed

🐛 Bug Fixes

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.13...v9.3.0-beta.14

vue-i18n - v9.3.0-beta.13

Published by github-actions[bot] almost 2 years ago

This is new release flow test release

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.12...v9.3.0-beta.13

vue-i18n - v9.3.0-beta.12

Published by github-actions[bot] almost 2 years ago

This is new release flow test release

Full Changelog: https://github.com/intlify/vue-i18n-next/compare/v9.3.0-beta.11...v9.3.0-beta.12

vue-i18n - v9.3.0-beta.11

Published by kazupon almost 2 years ago

v9.3.0-beta.11 (2022-12-23)

⭐ Features

⚡ Improvement Features

  • core-base, shared, vue-i18n-core

📝 Documentation

Committers: 5