Closed nkbt closed 7 years ago
For example node-gettext.
node-gettext
I would expect factory to work somewhat like:
{ gettext: gettextFactory({gettext: nodeGettext}), ngettext: ngettextFactory({gettext: nodeGettext}) }
Currently passing separate function require to bind gettext instance or use lambdas like:
gettext
{ gettext: gettextFactory({gettext: (...args) => nodeGettext.gettext(...args)}), ngettext: ngettextFactory({ngettext: (...args) => nodeGettext.ngettext(...args)}) }
Ideally I would expect something like:
const whatever = gettextFactory({gettext: nodeGettext}); console.log(whatever.gettext`Bla`); console.log(whatever.ngettext(10)`One foo|{{count: 10}} foos`);
Based on #10 this becomes
import {factory} from 'react-i18n-interpolation'; const whatever = factory({gettext: nodeGettext}); ... // rest as above
👍
For example
node-gettext
.I would expect factory to work somewhat like:
Currently passing separate function require to bind
gettext
instance or use lambdas like:Ideally I would expect something like: