Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from panter/features/component-plurals
Browse files Browse the repository at this point in the history
Features/component plurals
  • Loading branch information
claudiocro committed Jul 19, 2018
2 parents bc0bdf1 + f2b5508 commit d8f5fba
Show file tree
Hide file tree
Showing 5 changed files with 353 additions and 510 deletions.
56 changes: 56 additions & 0 deletions README.md
Expand Up @@ -158,8 +158,64 @@ Vue.component("app", {
</i18next>
</div>`
});

Vue.component("app", {
template: `
<div>
<i18next path="term" tag="label">
<a href="#" target="_blank">{{ $t("tos") }}</a>
<strong>{{ $t("promise") }}</strong>
</i18next>
</div>`
});
```
```javascript
// i18next component support to specify the place

const locales = {
en: {
tos: "Term of Service",
term: "I accept {{tos}}. {{promise}}.",
promise: "I promise"
}
};

...

Vue.component("app", {
template: `
<div>
<i18next path="term" tag="label">
<a href="#" target="_blank" place="tos">{{ $t("tos") }}</a>
<strong place="promise">{{ $t("promise") }}</strong>
</i18next>
</div>`
});
```
```javascript
// i18next component support the ($t)[https://www.i18next.com/overview/api#t] options param

const locales = {
en: {
counter: "{{0}} dude",
counter_plural: "{{0}} dudes"
}
};

...

Vue.component("app", {
template: `
<div>
<i18next path="term" tag="label" options="{ count: 2 }">
<strong>Hello</strong>
</i18next>
</div>`
});

### Directive

Full Featured properties:
Expand Down

0 comments on commit d8f5fba

Please sign in to comment.