diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/y18n/README.md | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/y18n/README.md')
-rw-r--r-- | node_modules/y18n/README.md | 18 |
1 files changed, 18 insertions, 0 deletions
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] +[](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: <code>__`hello ${'world'}`</code>. 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 |