Tiqa / redux-polyglot

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

Lodash assign for react native support #99

Closed rjerue closed 6 years ago

rjerue commented 6 years ago

Love this library for use of Polyglot with web development. I'm working on a react native project with shared items to a react.js project and wanted to use this library for i18n. However, Object.assign in React-Native does not allow for enumerable keys to be prototypes on objects, and they are for Polygots.

The solution is to change the {... p, ...} (which is Object.assign) to use Lodash's assign instead.

rjerue commented 6 years ago

I'll look into fixing the jest tests... ~As of now, Jest isn't detecting that anything is found.~ Running from wrong folder...

rjerue commented 6 years ago

Changes made, passes all unit tests now. Still works in my app too.

Hope other React-Native users find use for this.

guillaumearm commented 6 years ago

Nice work @rjerue, You are now part of redux-polyglot contributors.

Anyway, I just released redux-polyglot@0.6.5 on latest npm dist-tag.