Comparing version 1.2.0 to 1.2.1
@@ -46,2 +46,6 @@ (function() { | ||
// set locale & i18n in req | ||
req.locale = locales[0]; | ||
req.i18n = i18n; | ||
i18n.setLng(locales[0], function() { | ||
@@ -48,0 +52,0 @@ i18n.persistCookie(req, res, i18n.lng()); |
{ | ||
"author": "Jan Muehlemann <jan.muehlemann@gmail.com>" | ||
, "name": "i18next" | ||
, "description": "A i18n middleware for the Express.js framework." | ||
, "version": "1.2.0" | ||
, "repository": { | ||
"type": "git" | ||
, "url": "git@github.com:jamuhl/i18next-node.git" | ||
} | ||
, "private": false | ||
, "main": "index.js" | ||
, "directories": { | ||
"author": "Jan Muehlemann <jan.muehlemann@gmail.com>", | ||
"name": "i18next", | ||
"description": "A i18n middleware for the Express.js framework.", | ||
"version": "1.2.1", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:jamuhl/i18next-node.git" | ||
}, | ||
"private": false, | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"engines": { | ||
"node": ">v0.4.0" | ||
}, | ||
"dependencies": { | ||
"cookies": ">= 0.1.6" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~0.10.2" | ||
}, | ||
"scripts": { | ||
"test": "make test" | ||
} | ||
, "engines": { | ||
"node": ">v0.4.0" | ||
} | ||
, "dependencies": { | ||
"cookies": ">= 0.1.6" | ||
} | ||
, "devDependencies": { } | ||
, "scripts": { | ||
} | ||
} |
@@ -12,2 +12,4 @@ # Introduction | ||
[![Build Status](https://secure.travis-ci.org/jamuhl/i18next-node.png)](http://travis-ci.org/jamuhl/i18next-node) | ||
# installation | ||
@@ -14,0 +16,0 @@ |
@@ -30,2 +30,6 @@ var express = require('express') | ||
app.get('/str', function(req, res) { | ||
res.send('locale: ' + req.locale + '<br /> key nav.home -> ' + req.i18n.t('nav.home')); | ||
}); | ||
app.listen(3000); |
@@ -7,5 +7,5 @@ var i18n = require('../index') | ||
it('should be to init i18next without option', function(done) { | ||
it('should init i18next without option', function(done) { | ||
i18n.init(function(t) { | ||
assert.equal(i18n.lng(),'dev'); | ||
assert.equal(typeof t,'function'); | ||
@@ -12,0 +12,0 @@ done(); |
//run tests with cmd | ||
//mocha --globals i,len test/* | ||
//make test |
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
44647
26
866
86
1