Tiqa / redux-polyglot

Polyglot.js bindings for Redux
MIT License
58 stars 13 forks source link

Is there a way to set the onMissingKey and allowMissing property of Polyglot ? #67

Closed tata9001 closed 7 years ago

guillaumearm commented 7 years ago

Hmmm, i don't know, I will check for this tonight ;-)

guillaumearm commented 7 years ago

Nope, you can't. it will be fixed very soon with a createGetP factory 👍

tata9001 commented 7 years ago

Thanks! Waiting for it....

guillaumearm commented 7 years ago

please check for https://github.com/Tiqa/redux-polyglot/tree/feat/createGetP is it ok for you ?

I don't want to push this without test on a real project. Do you want a release candidate ?

guillaumearm commented 7 years ago

Need documentation about this before publish on redux-polyglot@latest

tata9001 commented 7 years ago

I have already tested it on my project. It's ok for me. Thanks!

guillaumearm commented 7 years ago

ok, i'll write documentation soon for this (maybe tonight).

guillaumearm commented 7 years ago

I'm thinking to add a function setPolyglotOptions to redux-polyglot. even if you can create your own getP, I want to mutate getP polyglot options.

so you can import the basic getP function and use setPolyglotOptions once at the start of your app. This is the easy way to change polyglot options.

createGetPis the pure alternative, very useful for unit testing.

@wangyun1517 @JalilArfaoui @jvincent42 ? what do you think about ? :-)

example :

import { setPolyglotOptions } from 'redux-polyglot';

const options = { allowMissing: true };
dispatch(setPolyglotOptions(options));
guillaumearm commented 7 years ago

Let's talk about this in #68. Anyway, I just pre-release 0.4.0 on a next dist-tag ;-)

# to see available dist-tag
npm dist-tag ls redux-polyglot 

# install 0.4.0
npm install --save redux-polyglot@0.4.0