Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lingui-i18n

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lingui-i18n - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

10

lib/i18n.js

@@ -29,4 +29,4 @@ 'use strict';

constructor(language = '', messages = {}) {
this._language = language;
this._messages = messages;
this.activate(language);

@@ -58,3 +58,9 @@ this.t = (0, _t2.default)(this);

activate(language) {
if (language) this._language = language;
if (!language) return;
if (!(language in _plurals2.default)) {
throw new Error(`Unknown locale "${language}".`);
}
this._language = language;
}

@@ -61,0 +67,0 @@

26

lib/select.js

@@ -10,7 +10,7 @@ 'use strict';

const plural = i18n => (_ref) => {
let value = _ref.value;
var _ref$offset = _ref.offset;
let offset = _ref$offset === undefined ? 0 : _ref$offset,
other = _ref.other,
let {
value,
offset = 0,
other
} = _ref,
pluralForms = _objectWithoutProperties(_ref, ['value', 'offset', 'other']);

@@ -23,7 +23,7 @@

const selectOrdinal = i18n => (_ref2) => {
let value = _ref2.value;
var _ref2$offset = _ref2.offset;
let offset = _ref2$offset === undefined ? 0 : _ref2$offset,
other = _ref2.other,
let {
value,
offset = 0,
other
} = _ref2,
pluralForms = _objectWithoutProperties(_ref2, ['value', 'offset', 'other']);

@@ -36,4 +36,6 @@

function select(_ref3) {
let value = _ref3.value,
other = _ref3.other,
let {
value,
other
} = _ref3,
selectForms = _objectWithoutProperties(_ref3, ['value', 'other']);

@@ -40,0 +42,0 @@

@@ -13,5 +13,3 @@ 'use strict';

if (!Array.isArray(strings)) {
const id = strings.id,
params = strings.params;
const { id, params } = strings;
return i18n.translate({ id, params });

@@ -18,0 +16,0 @@ }

{
"name": "lingui-i18n",
"version": "0.2.0",
"version": "0.2.1",
"description": "I18n tools for javascript",

@@ -26,6 +26,6 @@ "main": "lib/index.js",

"devDependencies": {
"babel-cli": "^6.22.2",
"babel-cli": "^6.23.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.22.0",
"babel-polyfill": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.1.8",

@@ -32,0 +32,0 @@ "rimraf": "^2.5.4"

Sorry, the diff of this file is not supported yet

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