Skip to content

Commit 14ce00a

Browse files
committed
docs improved
1 parent 5df6aee commit 14ce00a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ var i18n = new Translator(translations);
2727
console.log(i18n.gettext('hello world')); //ola mundo
2828
```
2929

30+
## Sprintf
31+
32+
This library includes [sprintf](https://github.com/alexei/sprintf.js) dependency implemented in the short methods:
33+
34+
```js
35+
i18n.__('Hello %s', 'world'); //Hello world
36+
i18n.n__('One comment', '%s comments', 12, 12); //12 comments
37+
```
38+
3039
## API
3140

32-
method | short | description
41+
Long method | Short + sprintf | description
3342
------ | ----- | -----------
3443
gettext | __ | Returns a translation
3544
ngettext | n__ | Returns a translation with singular/plural variations
@@ -39,12 +48,3 @@ pgettext | p__ | Returns a translation with a specific context
3948
dgettext | d__ | Returns a translation with a specific domain
4049
dpgettext | dp__ | Returns a translation with a specific domain and context
4150
dnpgettext | dnp__ | Returns a translation with a specific domain, context and singular/plural variations
42-
43-
## Sprintf
44-
45-
This library includes [sprintf](https://github.com/alexei/sprintf.js) dependency implemented in the short methods:
46-
47-
```js
48-
i18n.__('Hello %s', 'world'); //Hello world
49-
i18n.n__('One comment', '%s comments', 12, 12); //12 comments
50-
```

0 commit comments

Comments
 (0)