Socket
Socket
Sign inDemoInstall

lingui-react

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lingui-react - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

2

lib/I18nProvider.js

@@ -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 @@ )

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc