Closed guillaumearm closed 7 years ago
Must be optional and non-breaking
ok for this 👍
i will write unit tests soon, are you ok for publish it on npmjs without 100% coverage and without documentation ?
Well, coverage is still high and adoption is still low :-) ... I think you can publish.
fixed in #29
new implementation :
// all this lines return an enhanced Dummy component
translate(Dummy);
translate('catalog', Dummy);
translate('catalog')(Dummy);
I'm not a sure add an object instead of the string. It's more simple like this ( to use and to code ). @JalilArfaoui ? @jvincent42 ?
I just remove the possibility of passing an object because I really doesn't like this.
// too heavy
{ polyglotScope: 'scope' }
(see #29)
translate enhancer could take a string named 'polyglotScope' to default browse in the phrases when use a
t
function :but could be this :
if you have a phrases object like :
you just need to do a
p.t('hello')