due to #77 and other issues, I think it's time to plan to do some breaking changes.
My first idea is to change the actual translate component enhancer in order to support all react-redux features.
In addition, I think that using a function named `translate' to connect a component to a redux store is a bit confusing
I propose a mapStateToProps enhancer which can be named withPolyglot :
connect(
withPolyglot('my_scope')(mapStateToProps),
mapDispatchToProps,
mergeProps,
options,
)(Component);
// example without scope
withPolyglot()(mapStateToProps);
// example without mapStateToProps;
withPolyglot('myScope')()
// example without scope and mapStateToProps
withPolyglot()();
due to #77 and other issues, I think it's time to plan to do some breaking changes.
My first idea is to change the actual
translate
component enhancer in order to support allreact-redux
features.In addition, I think that using a function named `translate' to connect a component to a redux store is a bit confusing
I propose a
mapStateToProps
enhancer which can be namedwithPolyglot
:Edit:
The usual case will be something like that :