Skip to content

Commit 89a2301

Browse files
committed
update docs
1 parent 36fa132 commit 89a2301

File tree

6 files changed

+30
-15
lines changed

6 files changed

+30
-15
lines changed

docs/.vitepress/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ const config = {
6666
text: 'ESLint Plugin',
6767
link: 'https://intlify.github.io/eslint-plugin-vue-i18n/'
6868
},
69+
{
70+
text: 'CLI Tooling',
71+
link: 'https://github.com/intlify/cli',
72+
},
6973
{
7074
text: 'Extensions',
7175
link: 'https://github.com/kazupon/vue-i18n-extensions'

docs/advanced/optimization.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# Optimization
22

33

4-
## Pre translations with extensions
5-
6-
You can pre-translation with vue-i18n-extensions.
7-
8-
About how to usage, see [here](https://github.com/intlify/vue-i18n-extensions).
9-
104
## Improve performance and reduce bundle size with runtime build only
115

126
As described in "[installation](installation##from-cdn-or-without-a-bundler)" section, Vue I18n offer the following two built ES modules for Bundler.
@@ -69,6 +63,7 @@ In vite, use `alias` option as below:
6963

7064
```js
7165
import path from 'path'
66+
import vue from '@vitejs/plugin-vue'
7267
import { pluginI18n } from '@intlify/vite-plugin-vue-i18n'
7368

7469
import type { UserConfig } from 'vite'
@@ -79,6 +74,7 @@ const config: UserConfig = {
7974
'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
8075
},
8176
plugins: [
77+
vue(),
8278
pluginI18n({
8379
include: path.resolve(__dirname, './path/to/src/locales/**')
8480
})
@@ -106,3 +102,9 @@ The build will work without configuring these flags, however it is **strongly re
106102
:::tip NOTE
107103
The replacement value **must be boolean literals** and cannot be strings, otherwise the bundler/minifier will not be able to properly evaluate the conditions.
108104
:::
105+
106+
## Pre translations with extensions
107+
108+
You can pre-translation with vue-i18n-extensions.
109+
110+
About how to usage, see [here](https://github.com/intlify/vue-i18n-extensions).

docs/advanced/sfc.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ To use i18n custom blocks, you need to use the following plugins for bundler.
5454

5555
[vue-i18n-loader](https://github.com/intlify/vue-i18n-loader) is loader plugin for [webpack](https://webpack.js.org/). Since single file components is bundled with [vue-loader](https://github.com/vuejs/vue-loader), you need to setting webpack config with vue-i18n-loader.
5656

57-
:::tip NOTE
57+
:::tip REQUIREMENTS
5858
- webpack: **v4 or later**
5959
- vue-loader: **v16 or later**.
6060
:::
@@ -107,7 +107,7 @@ module.exports = {
107107

108108
[rollup-plugin-vue-i18n](https://github.com/intlify/rollup-plugin-vue-i18n) is rollup plugin for [rollup](https://rollupjs.org). Since single-file components is bundled with [rollup-plugin-vue](https://github.com/vuejs/rollup-plugin-vue), you need to setting rollup config with rollup-plugin-vue
109109

110-
:::tip NOTE
110+
:::tip REQUIREMENTS
111111
- rollup: **v2.32 or later**
112112
- rollup-plugin-vue: **v6 or later**.
113113
:::
@@ -157,8 +157,9 @@ export default [
157157

158158
[vite-plugin-vue-i18n](https://github.com/intlify/vite-plugin-vue-i18n) is vite plugin for [Vite](https://github.com/vitejs/vite).
159159

160-
:::tip NOTE
161-
- vite: **v1 or later**.
160+
:::tip REQUIREMENTS
161+
- vite: **v2-beta or later**.
162+
- @vitejs/plugin-vue: **v1.0.4 or later**.
162163
:::
163164

164165
#### Installation
@@ -173,19 +174,22 @@ vite config for example:
173174

174175
```ts
175176
import path from 'path'
177+
import vue from '@vitejs/plugin-vue'
176178
import { pluginI18n } from '@intlify/vite-plugin-vue-i18n'
177179

178180
import type { UserConfig } from 'vite'
179181

180182
const config: UserConfig = {
181183
plugins: [
184+
vue(),
182185
pluginI18n({
183-
include: path.resolve(__dirname, './path/to/src/locales/**')
186+
include: path.resolve(__dirname, './locales/**')
184187
})
185188
]
186189
}
187190

188191
export default config
192+
189193
```
190194

191195
## Define locale lessages importing

docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<script src="https://unpkg.com/vue-i18n@next"></script>
2020
```
2121

22-
You can also use a specific version/tag via URLs like <https://unpkg.com/[email protected].8/dist/vue-i18n.global.js>
22+
You can also use a specific version/tag via URLs like <https://unpkg.com/[email protected].18/dist/vue-i18n.global.js>
2323

2424
### ES Modules import
2525

@@ -28,7 +28,7 @@ You can also use a specific version/tag via URLs like <https://unpkg.com/vue-i18
2828
<script type="module" src="https://unpkg.com/vue-i18n@next/dist/vue-i18n.esm-browser.js">
2929
```
3030
31-
You can also use a specific version/tag via URLs like <https://unpkg.com/[email protected].8/dist/vue-i18n.esm-browser.js>
31+
You can also use a specific version/tag via URLs like <https://unpkg.com/[email protected].18/dist/vue-i18n.esm-browser.js>
3232
3333
3434
## Package managers

docs/migration/breaking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ console.log(VueI18n.availability)
280280

281281
### Remove Custom formatter
282282

283-
TODO:
283+
**Reason**: Due to hard to provide custom formats in the new compiler and runtime APIs. We are planning to support it in the next major version to support in these APIs. if you would like to use ICU message format, you can use the [@formatjs/vue-intl](https://formatjs.io/docs/vue-intl/)
284284

285285
### Remove `preserveDirectiveContent` option
286286

docs/tooling.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,18 @@ Still not supported.
3030

3131
It easily integrates some localization lint features to your Vue.js Application.
3232

33+
### Intlify CLI
34+
35+
[@intlify/cli](https://github.com/intlify/cli) is CLI Tooling for i18n development.
36+
37+
You can pre-compile i18n resources (`json5?`, `ya?ml`) with `intlify compile` command.
38+
3339
### Extensions
3440

3541
[vue-i18n-extensions](https://github.com/intlify/vue-i18n-extensions) provides some extensions for Vue I18n.
3642

3743
You can use this extension to enable SSR and improve i18n performance.
3844

39-
4045
## Third-party tooling
4146

4247
### BabelEdit

0 commit comments

Comments
 (0)