Socket
Socket
Sign inDemoInstall

react-localization

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-localization - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

6

lib/LocalizedStrings.js

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

10

package.json
{
"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);

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