Open gotrecillo opened 6 years ago
Sure, PRs are welcome 👍
a @@polyglot/ADD_PHRASES
action ?
const addPhrases = (locale, phrases) => ({
type: '@@polyglot/ADD_PHRASES',
payload: { locale, phrases },
});
In your case, if you want to add phrases, you have to be aware of your current locale in your own code (you can use getLocale selector).
dispatch a ADD_PHRASES
with wrong locale won't do anything.
Regarding #15, we would make a cache of phrases, ADD_PHRASES
should be take in consideration too.
Actually, there is no way to make a cache of phrases, so it's not the scope of this issue.
Anyway, thank you for taking the time to make an issue :-)
I will make it this weekend 👍
It can be nice to dynamically add phrases without removing the old ones, for example when using code splitting it can be nice to be able to do it.
Are you open to a pull request with this?