lingui-react
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -87,3 +87,3 @@ 'use strict'; | ||
if (language !== prevProps.language || messages !== prevProps.messages) { | ||
this.i18nManager.update({ language, messages }); | ||
this.i18nManager.update({ language: language, messages: messages }); | ||
} | ||
@@ -90,0 +90,0 @@ } |
@@ -49,3 +49,3 @@ 'use strict'; | ||
var form = _plurals2.default[language].cardinal(n); | ||
var translation = this.props[`_${value}`] || this.props[form]; | ||
var translation = this.props['_' + value] || this.props[form]; | ||
@@ -52,0 +52,0 @@ return _react2.default.createElement( |
@@ -50,3 +50,3 @@ 'use strict'; | ||
var form = ordinalRules ? ordinalRules(n) : 'other'; | ||
var translation = this.props[`_${n}`] || this.props[form]; | ||
var translation = this.props['_' + n] || this.props[form]; | ||
@@ -53,0 +53,0 @@ return _react2.default.createElement( |
@@ -39,3 +39,3 @@ 'use strict'; | ||
language: props.i18n.language, | ||
translation | ||
translation: translation | ||
}; | ||
@@ -42,0 +42,0 @@ return _this; |
{ | ||
"name": "lingui-react", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "React components for translations", | ||
@@ -35,4 +35,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"lingui-formats": "^0.2.0", | ||
"lingui-i18n": "^0.5.0" | ||
"lingui-formats": "^v0.3.0", | ||
"lingui-i18n": "^v0.6.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "scripts": { |
@@ -98,5 +98,9 @@ // @flow | ||
const { node } = mountHoc({}, { withRef: true }) | ||
expect(node.node.getWrappedInstance()).not.toBeNull() | ||
expect(node.node.getWrappedInstance().customMethod).not.toBeNull() | ||
expect(node.node.getWrappedInstance().customMethod()).toEqual(42) | ||
const hoc = node.getNode() | ||
// $FlowIgnore: getWrappedInstance() is custom method of WithI18n | ||
expect(hoc.getWrappedInstance()).not.toBeNull() | ||
// $FlowIgnore: getWrappedInstance() is custom method of WithI18n | ||
expect(hoc.getWrappedInstance().customMethod).not.toBeNull() | ||
// $FlowIgnore: getWrappedInstance() is custom method of WithI18n | ||
expect(hoc.getWrappedInstance().customMethod()).toEqual(42) | ||
}) | ||
@@ -106,3 +110,4 @@ | ||
const { node } = mountHoc() | ||
expect(() => node.node.getWrappedInstance()).toThrow( | ||
// $FlowIgnore: getWrappedInstance() is custom method of WithI18n | ||
expect(() => node.getNode().getWrappedInstance()).toThrow( | ||
'To access the wrapped instance, you need to specify { withRef: true } in the options argument of the withI18n() call.' | ||
@@ -109,0 +114,0 @@ ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115479
2128
+ Addedlingui-formats@0.3.00.4.6(transitive)
+ Addedlingui-i18n@0.6.6(transitive)
- Removedlingui-formats@0.2.0(transitive)
- Removedlingui-i18n@0.5.0(transitive)
Updatedlingui-formats@^v0.3.0
Updatedlingui-i18n@^v0.6.0