Skip to content

Commit

Permalink
docs: correct examples in README (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
QmarkC committed Aug 5, 2020
1 parent c518421 commit e037d0b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Expand Up @@ -13,9 +13,9 @@ Inspired by [i18n](https://www.npmjs.com/package/i18n).
_simple string translation:_

```js
var __ = require('y18n').__
const __ = require('y18n')().__;

console.log(__('my awesome string %s', 'foo'))
console.log(__('my awesome string %s', 'foo'));
```

output:
Expand All @@ -25,10 +25,11 @@ output:
_using tagged template literals_

```js
var __ = require('y18n').__
var str = 'foo'
const __ = require('y18n')().__;

console.log(__`my awesome string ${str}`)
const str = 'foo';

console.log(__`my awesome string ${str}`);
```

output:
Expand All @@ -38,9 +39,9 @@ output:
_pluralization support:_

```js
var __n = require('y18n').__n
const __n = require('y18n')().__n;

console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'))
console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'));
```

output:
Expand Down

0 comments on commit e037d0b

Please sign in to comment.