Skip to content

Commit

Permalink
📝 docs(vuepress): easier to understand (#432) by @vicbergquist
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmeow authored and kazupon committed Oct 11, 2018
1 parent de03589 commit 94583e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gitbook/en/component.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Component based localization

In general, locale info (e.g. `locale`,`messages`, etc) is set as constructor option of `VueI18n` instance and it sets `i18n` option as root Vue instance. Therefore you can globally translate with using `$t` or `$tc` in the root Vue instance and any composed component.
In general, locale info (e.g. `locale`,`messages`, etc) is set as a constructor option of the `VueI18n` instance and it sets the `i18n` option as a root Vue instance. This means you can use translations globally by using `$t` or `$tc` in the root Vue instance and any composed component.
You can also manage locale info for each component separately, which might be more convenient due to Vues component oriented design.

Component based localization example:
Expand Down
8 changes: 4 additions & 4 deletions gitbook/en/fallback.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fallback localization

The following locale messages that not exist `message` key in `ja` locale:
When the `message` key does not exist in the `ja` locale:

```javascript
const messages = {
Expand All @@ -12,7 +12,7 @@ const messages = {
}
```

When specify the `fallbackLocale` option to VueI18n constructor option, `message` key is localized with `en` locale key:
And you have specified a `fallbackLocale` in the VueI18n constructor option, the `message` key uses the corresponding `en` locale key as a fallback:

```javascript
const i18n = new VueI18n({
Expand All @@ -22,13 +22,13 @@ const i18n = new VueI18n({
})
```

Template the below:
When you template the below:

```html
<p>{{ $t('message') }}</p>
```

Output the below:
The following will be the output:

```html
<p>hello world</p>
Expand Down

0 comments on commit 94583e5

Please sign in to comment.