-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update information for 4.0 release
- includes the new version in various places - adding new v3 -> v4 migration guide - more removal badges - fixing typos/reformatting
- Loading branch information
Showing
8 changed files
with
116 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,8 @@ | ||
# Single file components: `<i18n>` <Badge type="danger" text="Removed in 3.0" /> | ||
|
||
::: danger NOTE | ||
`<i18n>` blocks are no longer supported in `i18next-vue` v3. This is probably already not working in v2, because there are no Vue 3 loaders producing the right format. | ||
`<i18n>` blocks are no longer supported since `i18next-vue` v3. This is probably already not working in v2, | ||
because there are no Vue 3 loaders producing the right format. | ||
::: | ||
|
||
|
||
by [@kazupon](https://github.com/kazupon) | ||
|
||
Single File Components can have an `<i18n>` block for defining translations locally in the component. | ||
|
||
```vue | ||
<i18n> { "en": { "hello": "hello world!" } } </i18n> | ||
<template> | ||
<div id="app"><p>message: {{ $t('hello') }}</p></div> | ||
</template> | ||
<script> | ||
export default { | ||
name: "app" | ||
}; | ||
</script> | ||
``` | ||
|
||
## i18n tag | ||
|
||
To use the `<i18>` tag you need to use vue-loader: | ||
|
||
``` | ||
npm install @kazupon/vue-i18n-loader --save-dev | ||
``` | ||
|
||
For detailed documentation check the [original docs](https://github.com/kazupon/vue-i18n-loader). | ||
|
||
``` | ||
// vue-loader (~v14.x): | ||
module.exports = { | ||
// ... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader', | ||
options: { | ||
loaders: { | ||
// you need to specify `i18n` loaders key with `vue-i18n-loader` (https://github.com/kazupon/vue-i18n-loader) | ||
i18n: '@kazupon/vue-i18n-loader' | ||
} | ||
} | ||
}, | ||
// ... | ||
] | ||
}, | ||
// ... | ||
} | ||
``` | ||
|
||
## Use it with YAML: | ||
|
||
``` | ||
npm install yaml-loader --save-dev | ||
``` | ||
|
||
```html | ||
<i18n> en: hello: "hello world!" </i18n> | ||
``` | ||
|
||
```javascript | ||
module.exports = { | ||
// ... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: "vue-loader", | ||
options: { | ||
preLoaders: { | ||
i18n: "yaml-loader" | ||
}, | ||
loaders: { | ||
i18n: "@kazupon/vue-i18n-loader" | ||
} | ||
} | ||
} | ||
// ... | ||
] | ||
} | ||
// ... | ||
}; | ||
``` | ||
Single File Components could have an `<i18n>` block for defining translations locally in the component before the removal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.