react-localization
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -22,2 +22,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -50,2 +52,3 @@ | ||
this.props = props; | ||
this.defaultLanguage = Object.keys(props)[0]; | ||
//Set language to its default value (the interface) | ||
@@ -69,3 +72,4 @@ this.setLanguage(this.interfaceLanguage); | ||
//console.log("There are strings for the language:"+language); | ||
var localizedStrings = Object.assign(this.props[Object.keys(this.props)[0]], this.props[this.language]); | ||
//Merge default | ||
var localizedStrings = _extends({}, this.props[this.defaultLanguage], this.props[this.language]); | ||
for (var key in localizedStrings) { | ||
@@ -72,0 +76,0 @@ //console.log("Checking property:"+key); |
{ | ||
"name": "react-localization", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Simple module to localize the React interface using the same syntax used in the ReactNativeLocalization module, use 'npm run build' before publishing", | ||
@@ -8,3 +8,3 @@ "scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "babel ./src/LocalizedStrings.js --presets babel-preset-es2015 --out-file ./lib/LocalizedStrings.js" | ||
"build": "babel ./src/LocalizedStrings.js --presets babel-preset-es2015,babel-preset-stage-2 --out-file ./lib/LocalizedStrings.js" | ||
}, | ||
@@ -31,4 +31,6 @@ "repository": { | ||
"babel-cli": "^6.22.2", | ||
"babel-preset-es2015": "^6.22.0" | ||
} | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-stage-2": "^6.22.0" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -40,2 +40,3 @@ 'use strict'; | ||
this.props = props; | ||
this.defaultLanguage = Object.keys(props)[0]; | ||
//Set language to its default value (the interface) | ||
@@ -55,3 +56,4 @@ this.setLanguage(this.interfaceLanguage); | ||
//console.log("There are strings for the language:"+language); | ||
var localizedStrings = Object.assign(this.props[Object.keys(this.props)[0]], this.props[this.language]); | ||
//Merge default | ||
var localizedStrings = {...this.props[this.defaultLanguage], ...this.props[this.language] }; | ||
for (var key in localizedStrings) { | ||
@@ -58,0 +60,0 @@ //console.log("Checking property:"+key); |
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
16914
256
3