From e037d0be165f1acd7fe899fa43e43ba6d0c7cc8f Mon Sep 17 00:00:00 2001 From: QmarkC Date: Wed, 5 Aug 2020 01:00:29 -0500 Subject: [PATCH] docs: correct examples in README (#94) --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b80abac5..2d0b6cca 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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: @@ -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: