react-localize
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -58,4 +58,4 @@ 'use strict'; | ||
}, | ||
localize: function localize(key) { | ||
var values = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; | ||
localize: function localize(key, values) { | ||
values = values || []; | ||
var _props = this.props; | ||
@@ -62,0 +62,0 @@ var messages = _props.messages; |
@@ -7,2 +7,6 @@ # Change Log | ||
## 1.1.1 2016-08-02 | ||
### Fixed | ||
- Bug to handle passing `null` to `localize('label', null)` more gracefully | ||
## 1.1.0 2016-08-02 | ||
@@ -9,0 +13,0 @@ ### Added |
{ | ||
"name": "react-localize", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A simple context wrapper and text localization component for localizing strings", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -35,3 +35,4 @@ import defaultLocalizer from './util/localize-formatter'; | ||
localize(key, values=[]) { | ||
localize(key, values) { | ||
values = values || []; | ||
const { messages, xLocale } = this.props; | ||
@@ -38,0 +39,0 @@ |
@@ -89,2 +89,16 @@ import Chai from 'chai'; | ||
it('ignores provided values if is null', () => { | ||
const messages = { | ||
'thisMessage': 'thatMessage' | ||
}; | ||
let output = ReactDOMServer.renderToString( | ||
<Localization messages={messages}> | ||
<BasicElement customMessage='thisMessage' values={null}/> | ||
</Localization> | ||
); | ||
expect(output).to.include('>thatMessage<'); | ||
}); | ||
it('adds a data key when localize is in debug mode', () => { | ||
@@ -91,0 +105,0 @@ const messages = { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
32423
609
0