Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions docs/guide/i18n-options.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# i18nOptions


## namespaces

The namespace will be loaded with (loadNamespaces)[http://i18next.com/docs/api/#load-namespaces],so one can lazy load namespaces for components.
The namepace will not be loaded automatically, see [loadComponentNamespace](/guide/started.html#init)

```javascript
const locales = {
Expand Down Expand Up @@ -51,7 +50,6 @@ const app = {
}
};


i18next.init({
lng: "en",
fallbackLng: "en",
Expand All @@ -63,7 +61,7 @@ i18next.init({
const i18n = new VueI18next(i18next);

Vue.component("app", {
i18nOptions: { namespaces: ["app","common"] },
i18nOptions: { namespaces: ["app", "common"] },
template: `<strong>{{ $t("promise") }}</strong>`
});
```
Expand Down Expand Up @@ -97,6 +95,7 @@ Vue.component('app', {
```

## messages

Translations can not only be defined in translation files but also in the `i18nOptions`.

```javascript
Expand Down Expand Up @@ -142,4 +141,3 @@ Vue.component('app', {
</div>`,
});
```

8 changes: 8 additions & 0 deletions docs/guide/started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ new Vue({
i18n: i18n,
});
```

## Init options

| Name | Description |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **loadComponentNamespace** | When using the [namespace options](/guide/i18n-options.md#namespaces) the namespaces will be loaded with [loadNamespaces](https://www.i18next.com/overview/api#loadnamespaces),<br>so one can lazy load namespaces for components. |
| **bindI18n** | Listen for `i18next` events and refreshes the component.<br>Check the [i18next documentation for more infos](https://www.i18next.com/overview/api#events) |
| **bindStore** | Listen for `i18next` store events and refreshes the component.<br>Check the [i18next store documentation for more infos](https://www.i18next.com/overview/api#store-events) |