Comparing version 0.8.6 to 0.9.0
16
i18n.js
/** | ||
* @author Created by Marcus Spiegel <marcus.spiegel@gmail.com> on 2011-03-25. | ||
* @author Created by Marcus Spiegel <spiegel@uscreen.de> on 2011-03-25. | ||
* @link https://github.com/mashpie/i18n-node | ||
* @license http://opensource.org/licenses/MIT | ||
* | ||
* @version 0.8.3 | ||
*/ | ||
@@ -13,2 +11,3 @@ | ||
var vsprintf = require('sprintf-js').vsprintf, | ||
pkgVersion = require('./package.json').version, | ||
fs = require('fs'), | ||
@@ -25,3 +24,2 @@ url = require('url'), | ||
// exports an instance | ||
@@ -69,3 +67,3 @@ module.exports = (function() { | ||
i18n.version = '0.8.3'; | ||
i18n.version = pkgVersion; | ||
@@ -332,3 +330,3 @@ i18n.configure = function i18nConfigure(opt) { | ||
// some template engines pass all values as strings -> so we try to convert them to numbers | ||
if (typeof plural === 'number' || parseInt(plural, 10) + '' === plural) { | ||
if (typeof plural === 'number' || Number(plural) + '' === plural) { | ||
count = plural; | ||
@@ -344,3 +342,3 @@ } | ||
// called like __n('cat', 3) | ||
if (typeof plural === 'number' || parseInt(plural, 10) + '' === plural) { | ||
if (typeof plural === 'number' || Number(plural) + '' === plural) { | ||
count = plural; | ||
@@ -365,3 +363,3 @@ | ||
// enforce number | ||
count = parseInt(count, 10); | ||
count = Number(count); | ||
@@ -546,3 +544,3 @@ // find the correct plural rule for given locale | ||
if (typeof count === 'number') { | ||
msg = vsprintf(msg, [parseInt(count, 10)]); | ||
msg = vsprintf(msg, [Number(count)]); | ||
} | ||
@@ -549,0 +547,0 @@ |
{ | ||
"name": "i18n", | ||
"description": "lightweight translation module with dynamic json storage", | ||
"version": "0.8.6", | ||
"version": "0.9.0", | ||
"homepage": "http://github.com/mashpie/i18n-node", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
323773
1428