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

i18next-conv

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-conv - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

44

lib/gettextWrapper.js

@@ -124,8 +124,19 @@ var Gettext = require("node-gettext")

if (ext.numbers.length === 2) {
if (suffix === '-1') {
suffix = '1';
} else if (suffix === '1') {
suffix = '2';
// germanic like en
if (ext.numbers[0] === 2) {
if (suffix === '-1') { // regular plural
suffix = '1';
} else if (suffix === '1') { // singular
suffix = '2';
}
}
// romanic like fr
else if (ext.numbers[0] === 1) {
if (suffix === '-1') { // regular plural
suffix = '2';
} else if (suffix === '1') { // singular
suffix = '1';
}
}
}
}

@@ -271,7 +282,20 @@ for (var i = 0, len = ext.numbers.length; i < len; i++) {

if (ext.numbers.length === 2) {
if (number === 2) {
number = 1; // is basic plural
} else if (number === 1) {
number = -1; // is singular
}
if (ext.numbers.length === 2) {
// germanic like en
if (ext.numbers[0] === 2) {
if (number === 2) {
number = 1; // singular
} else if (number === 1) {
number = -1; // regular plural
}
}
// romanic like fr
else if (ext.numbers[0] === 1) {
if (number === 2) {
number = -1; // regular plural
} else if (number === 1) {
number = 1; // singular
}
}
}
return number > 0 ? '' : '_plural';

@@ -278,0 +302,0 @@ } else {

@@ -1085,6 +1085,17 @@ // definition http://translate.sourceforge.net/wiki/l10n/pluralforms

if (ext.numbers.length === 2) {
if (number === 2) {
number = 1;
} else if (number === 1) {
number = -1;
// germanic like en
if (ext.numbers[0] === 2) {
if (number === 2) {
number = 1; // singular
} else if (number === 1) {
number = -1; // regular plural
}
}
// romanic like fr
else if (ext.numbers[0] === 1) {
if (number === 2) {
number = -1; // regular plural
} else if (number === 1) {
number = 1; // singular
}
}

@@ -1091,0 +1102,0 @@ } //console.log(count + '-' + number);

@@ -6,3 +6,3 @@ {

, "keywords": ["i18next", "gettext"]
, "version": "0.0.5"
, "version": "0.0.6"
, "private": false

@@ -9,0 +9,0 @@ , "preferGlobal": "true"

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