From e10e0ee5afeac898a40711f8746d06a5288806e9 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Fri, 4 Dec 2020 10:19:59 +0900 Subject: [PATCH] prerelease release v9.0.0-beta.9 (#208) * prerelease release v9.0.0-beta.9 * docs: update --- CHANGELOG.md | 23 ++++ README.md | 308 +++------------------------------------------------ package.json | 2 +- 3 files changed, 38 insertions(+), 295 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 709663ebd..48ee54831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,27 @@ +## v9.0.0-beta.9 (2020-12-04) + +#### :star: Features +* [#206](https://github.com/intlify/vue-i18n-next/pull/206) feat: resources merge to global scope ([@kazupon](https://github.com/kazupon)) +* [#200](https://github.com/intlify/vue-i18n-next/pull/200) feat: add te for composition API ([@kazupon](https://github.com/kazupon)) + +#### :bug: Bug Fixes +* [#199](https://github.com/intlify/vue-i18n-next/pull/199) fix: plural rules compatibilites ([@kazupon](https://github.com/kazupon)) + +#### :zap: Improvement Features +* [#197](https://github.com/intlify/vue-i18n-next/pull/197) improve: component injection properties typing hints on VSCode ([@kazupon](https://github.com/kazupon)) + +#### :boom: Breaking Change +* [#204](https://github.com/intlify/vue-i18n-next/pull/204) breaking: change globalInjection default disable ([@kazupon](https://github.com/kazupon)) + +#### :pencil: Documentation +* [#203](https://github.com/intlify/vue-i18n-next/pull/203) docs: typos in website header and submenu ([@chartrandf](https://github.com/chartrandf)) + +#### Committers: 2 +- Francis Chartrand ([@chartrandf](https://github.com/chartrandf)) +- kazuya kawaguchi ([@kazupon](https://github.com/kazupon)) + + ## v9.0.0-beta.8 (2020-11-18) #### :bug: Bug Fixes diff --git a/README.md b/README.md index 40c93c372..642406234 100644 --- a/README.md +++ b/README.md @@ -32,52 +32,12 @@ Internationalization plugin for Vue.js ## Status: Beta ![Test](https://github.com/intlify/vue-i18n-next/workflows/Test/badge.svg) -The current codebase has most of the existing features on Vue I18n v8.x and is usable. +- [Documetantion](https://vue-i18n-next.intlify.dev/) (beta) +- If you use stable Vue I18n version, see this [repository](https://github.com/kazupon/vue-i18n) -Since the library is still unstable **and because we want feedback** on bugs and missing features, **it will probably go through a few breaking changes**. - -If you use stable Vue I18n version, see this [repository](https://github.com/kazupon/vue-i18n) - -## :star: New Features - -### Message Format Syntax -- Literal Interpolation - - You can use a single quote `'` and "Mustache" like (`{` `}` ) to make the message literal. - - e.g. `foo{'@'}domain.com` -- Message Functions - - As with Vue's render function, vue-i18n-next (and future releases) support the **Message** functions. - - Using the Message function has the following advantages: - - Accelerate evaluation of vue-i18n messages (pre-compilation) - - Support for complex i18n that cannot be handled by message format - -### Composition API - -New style API for Vue Composition API. See the following docs: - -- [createI18n](https://vue-i18n-next.intlify.dev/api/general.html#createi18n) - - [I18nOptions](https://vue-i18n-next.intlify.dev/api/general.html#i18noptions) - - [ComposerOptions](https://vue-i18n-next.intlify.dev/api/composition.html#composeroptions) - - [VueI18nOptions](https://vue-i18n-next.intlify.dev/api/legacy.html#vuei18noptions) -- [useI18n](https://vue-i18n-next.intlify.dev/api/composition.html#usei18n) - - [ComposerOptions](https://vue-i18n-next.intlify.dev/api/composition.html#composeroptions) -- [Composer](https://vue-i18n-next.intlify.dev/api/composition.html#composer) -- [VueI18n](https://vue-i18n-next.intlify.dev/api/legacy.html#vuei18n) - -### `` Component (formerly called `` component) - -You can use pluralization on the component. See the below examples: - -- [Example with using Composition API](https://github.com/intlify/vue-i18n-next/blob/master/examples/composition/components/translation.html) -- [Example with using Legacy API](https://github.com/intlify/vue-i18n-next/blob/master/examples/legacy/components/translation.html) - -### `` Component - -You can use datetime format on the component, like `` component. - -See the below examples: - -- [Example with using Composition API](https://github.com/intlify/vue-i18n-next/blob/master/examples/composition/components/datetime-format.html) -- [Example with using Legacy API](https://github.com/intlify/vue-i18n-next/blob/master/examples/legacy/components/datetime-format.html) +## :raising_hand: About support for v9 and earlier +- v6 and earlier: drop supporting +- v7 and v8: become LTS upon vue-i18n v9 release with an 12 months maintenance lifespan ## :lollipop: Examples @@ -86,262 +46,22 @@ See the [`examples`](https://github.com/intlify/vue-i18n-next/tree/master/exampl The examples are offered in thee following two API styles: - composition - - Examples with using new vue-i18n API optimized for Vue 3 + - Examples with using new vue-i18n API for Vue 3 Composition API - legacy - Examples with using vue-i18n API that are almost compatible with vue-i18n v8.x -## :raising_hand: About support for v9 and earlier -- v6 and earlier: drop supporting -- v7 and v8: become LTS upon vue-i18n v9 release with an 15 months maintenance lifespan - -## :heavy_exclamation_mark: Known issues - -### :boom: Breaking changes compared to vue-i18n v8.x - -#### Message Format Syntax -- Special characters - - Since vue-i18n-next, the message format syntax is handled by the compiler. - - List interpolation is no longer allowed for array-like objects (e.g. `{ '0': 'hello' }`). - - The following characters used in the message syntax are processed by the compiler as special characters: - - `{`, `}`, `@`, `$`, `|` - - If you want to use these special characters, you can use **literal interpolation** to get around it. -- Linked messages - - No longer use grouping by brackets for key of linked messages. - - v9 and later use **named, list, and literal interpolations** - -#### APIs -- The return value of `$t` and `t` methods is **string** only. object and array values are no longer returned. - - As an alternative way, you can use `$tm` / `tm` -- The return value of `$tc` and `tc` methods is **string** only. object and array values are no longer returned. - - As an alternative way, you can use `$tm` / `tm` -- `VueI18n` class cannot used with `new`. It can only be used via the `$i18n` property of Vue instance. - - In vue-i18n-next, by replacing `new VueI18n` with `createI18n`, you can use existing `VueI18n` options as they are. - - See the `examples/legacy` directory. -- `VueI18n.prototype.getChoiceIndex` - - -> Legacy API style: `pluralizationRules` option of `createI18n` factory function (like `new VueI18n(...)`) - - -> Compsable API style: `pluralRules` option of `createI18nComposer` factory function -- `warnHtmlInMessage` option: - - Composition API: `warnHtmlMessage` boolean property, default `true`. - - Legacy API: `warnHtmlInMessage` property. - - For development mode, warning is default. - - For production mode, HTML message detect is not check due to performance. -- `v-t` directive - - `preserve` modifier deprecated, keep Element content - - Legacy API `preserveDirectiveContent` option, and property deprecated -- `VueI18n.version` -> `import { VERSION } from 'vue-i18n'` -- `VueI18n.availabilities` -> `import { availabilities } from 'vue-i18n'` -- See the details [here](https://github.com/intlify/vue-i18n-next/blob/master/docs/api/vue-i18n.md) - -#### Components -- `` component - - Rename to `` component - - Remove `Boolean` type from `tag` prop - - if `tag` prop is not specified, return the Fragment - - Remove the below props: - - `place` prop - - `places` prop - - `path` prop (Rename to `keypath` prop) -- `` component - - Remove `Boolean` type from `tag` prop - - if `tag` prop is not specified, return the Fragment - -### :zap: Improvements - -- See the [vue-i18n issues](https://github.com/kazupon/vue-i18n/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Ready%22) that are labeled with `Status: Ready` - - -### :hammer: Missing features - -- Custom formatting -- Tooling - - `@intlify/devtools` - - `vue-cli-plugin-i18n` - - `@intlify/eslint-plugin-vue-i18n` - - -## :cd: Installation - -### npm - -```bash -npm install --save vue-i18n@next -``` - -### yarn -```bash -yarn add vue-i18n@next -``` - -## :package: About dist files - -### From CDN or without a Bundler - -- **`vue-i18n.global(.prod).js`**: - - For direct use via `