From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/y18n/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'node_modules/y18n/README.md') diff --git a/node_modules/y18n/README.md b/node_modules/y18n/README.md index 9859458f2..826474f20 100644 --- a/node_modules/y18n/README.md +++ b/node_modules/y18n/README.md @@ -4,6 +4,7 @@ [![Coverage Status][coveralls-image]][coveralls-url] [![NPM version][npm-image]][npm-url] [![js-standard-style][standard-image]][standard-url] +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) The bare-bones internationalization library used by yargs. @@ -23,6 +24,19 @@ output: `my awesome string foo` +_using tagged template literals_ + +```js +var __ = require('y18n').__ +var str = 'foo' + +console.log(__`my awesome string ${str}`) +``` + +output: + +`my awesome string foo` + _pluralization support:_ ```js @@ -60,6 +74,10 @@ Create an instance of y18n with the config provided, options include: Print a localized string, `%s` will be replaced with `arg`s. +This function can also be used as a tag for a template literal. You can use it +like this: __`hello ${'world'}`. This will be equivalent to +`__('hello %s', 'world')`. + ### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) Print a localized string with appropriate pluralization. If `%d` is provided -- cgit v1.2.3