Comparing version 0.5.2 to 1.2.0
@@ -16,3 +16,2 @@ (function() { | ||
i18n.init = function(options, cb) { | ||
if (typeof options === 'function') { | ||
@@ -22,16 +21,21 @@ cb = options; | ||
} | ||
options = options || {}; | ||
options.resSetPath = options.resSetPath || 'locales/__lng__/__ns__.json'; | ||
options.sendMissing = options.saveMissing || false; | ||
options.useSync = options.useSync === undefined ? true : options.useSync; | ||
resStore = (options && options.resStore) ? options.resStore : {}; | ||
sync.configure({ | ||
options: i18n.functions.extend(i18n.options, options), | ||
functions: i18n.functions, | ||
resStore: resStore | ||
}); | ||
if (options.useSync) { | ||
i18n.functions.extend(i18n.sync, sync); | ||
} | ||
i18n.functions.extend(i18n.sync, sync); | ||
if (typeof i18n.sync.configure === 'function') { | ||
i18n.sync.configure({ | ||
options: i18n.functions.extend(i18n.options, options), | ||
functions: i18n.functions, | ||
resStore: resStore | ||
}); | ||
} | ||
@@ -60,3 +64,3 @@ orgInit(options, cb); | ||
app.get('/i18next/i18next.js', function(req, res) { | ||
var filename = (process.env.NODE_ENV !== 'production' || process.env['DEBUG']) ? __dirname + '/dep/i18next-1.1.1.js' : __dirname + '/dep/i18next-1.1.1.min.js'; | ||
var filename = (process.env.NODE_ENV !== 'production' || process.env['DEBUG']) ? __dirname + '/dep/i18next-1.2.js' : __dirname + '/dep/i18next-1.2.min.js'; | ||
@@ -132,2 +136,2 @@ fs.readFile(filename, function(err, data) { | ||
})(); | ||
})(); |
(function() { | ||
var i18n = require('./dep/i18next-1.1.1') | ||
var i18n = require('./dep/i18next-1.2') | ||
, url = require('url') | ||
@@ -5,0 +5,0 @@ , Cookies = require('cookies') |
@@ -5,3 +5,3 @@ { | ||
, "description": "A i18n middleware for the Express.js framework." | ||
, "version": "0.5.2" | ||
, "version": "1.2.0" | ||
, "repository": { | ||
@@ -8,0 +8,0 @@ "type": "git" |
# Introduction | ||
Project goal is to provide the same easy way to translate a website on serverside like in | ||
[i18next](http://jamuhl.github.com/i18next/) on the clientside: | ||
[i18next](https://github.com/jamuhl/i18next) on the clientside: | ||
@@ -6,0 +6,0 @@ - Translation inside your server code or template |
@@ -11,4 +11,7 @@ { | ||
"child": "__count__ Kind", | ||
"child_plural": "__count__ Kinder" | ||
"child_plural": "__count__ Kinder", | ||
"friend_context": "Ein Freund", | ||
"friend_context_male": "Ein Freund", | ||
"friend_context_female": "Eine Freundin" | ||
} | ||
} |
@@ -6,4 +6,7 @@ { | ||
"child": "__count__ child", | ||
"child_plural": "__count__ children" | ||
"child_plural": "__count__ children", | ||
"friend_context": "A friend", | ||
"friend_context_male": "A boyfriend", | ||
"friend_context_female": "A girlfriend" | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
43806
847
1
22