internationalization
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -21,2 +21,5 @@ // Generated by CoffeeScript 1.8.0 | ||
key = arguments[0], vars = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
if (!key) { | ||
return ""; | ||
} | ||
idx = key.indexOf(nsSeparator); | ||
@@ -23,0 +26,0 @@ if (idx !== -1) { |
{ | ||
"name": "internationalization", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "i18n", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,5 +0,5 @@ | ||
// Generated by CoffeeScript 1.8.0 | ||
// Generated by CoffeeScript 1.9.1 | ||
(function() { | ||
var debug, getAcceptLanguage, getInstance, middleware, | ||
__slice = [].slice; | ||
slice = [].slice; | ||
@@ -12,5 +12,5 @@ debug = require('debug')('i18n'); | ||
middleware = function(_arg) { | ||
middleware = function(arg) { | ||
var cookie, directory, env, fallback, nsSeparator, query, translator; | ||
cookie = _arg.cookie, directory = _arg.directory, fallback = _arg.fallback, nsSeparator = _arg.nsSeparator, query = _arg.query; | ||
cookie = arg.cookie, directory = arg.directory, fallback = arg.fallback, nsSeparator = arg.nsSeparator, query = arg.query; | ||
if (!directory) { | ||
@@ -37,2 +37,5 @@ throw new Error("you hava to specify directory for locales"); | ||
var lang; | ||
if (!req.cookies) { | ||
throw new Error("cookies not accessible"); | ||
} | ||
if (env === "development") { | ||
@@ -48,9 +51,9 @@ translator.load(directory); | ||
var args; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
return translator.translate.apply(translator, [lang].concat(__slice.call(args))); | ||
args = 1 <= arguments.length ? slice.call(arguments, 0) : []; | ||
return translator.translate.apply(translator, [lang].concat(slice.call(args))); | ||
}; | ||
res.locals.__ = function() { | ||
var args; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
return translator.translatePlural.apply(translator, [lang].concat(__slice.call(args))); | ||
args = 1 <= arguments.length ? slice.call(arguments, 0) : []; | ||
return translator.translatePlural.apply(translator, [lang].concat(slice.call(args))); | ||
}; | ||
@@ -57,0 +60,0 @@ res.locals.lang = lang; |
@@ -72,3 +72,3 @@ // Generated by CoffeeScript 1.8.0 | ||
} else { | ||
throw new Error("var '" + this.tokens[i] + "' missing in '" + this.template + "'"); | ||
throw new Error("var '" + this.tokens[i] + "' missing, required in '" + this.template + "'"); | ||
} | ||
@@ -75,0 +75,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34751
580
0