Comparing version 1.5.8 to 1.5.9
@@ -112,3 +112,3 @@ var cradle = require('cradle'); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -140,3 +140,3 @@ }, | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -169,3 +169,3 @@ }); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -172,0 +172,0 @@ }); |
@@ -108,3 +108,3 @@ var mongo = require('mongodb'); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -136,3 +136,3 @@ }, | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -165,3 +165,3 @@ }); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -168,0 +168,0 @@ }); |
@@ -93,3 +93,3 @@ var redis = require('redis'); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -121,3 +121,3 @@ }, | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -150,3 +150,3 @@ }); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -153,0 +153,0 @@ }); |
@@ -49,3 +49,3 @@ var fs = require('fs'); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -78,3 +78,3 @@ }, | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -108,3 +108,3 @@ }); | ||
} | ||
if (callback) callback(err); | ||
if (typeof callback === 'function') callback(err); | ||
}); | ||
@@ -111,0 +111,0 @@ }); |
@@ -28,2 +28,3 @@ (function() { | ||
options.detectLngFromPath = options.detectLngFromPath === undefined ? false : options.detectLngFromPath; | ||
options.forceDetectLngFromPath = false; | ||
resStore = options.resStore ? options.resStore : {}; | ||
@@ -30,0 +31,0 @@ |
@@ -32,2 +32,6 @@ (function() { | ||
} | ||
if (!locale && opts.forceDetectLngFromPath) { | ||
locale = opts.fallbackLng; | ||
} | ||
} | ||
@@ -34,0 +38,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "i18n made easy - full featured: middleware, template support plus clientside use", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -0,1 +1,5 @@ | ||
### v1.5.9 | ||
- bugfix throws error on savemissing key | ||
- force lng from path (issue 32) | ||
### v1.5.8 | ||
@@ -2,0 +6,0 @@ - updated client |
@@ -18,2 +18,3 @@ var i18n = require('../index') | ||
resStore: false, | ||
saveMissing: false, | ||
returnObjectTrees: false, | ||
@@ -20,0 +21,0 @@ debug: false |
@@ -17,2 +17,4 @@ var i18n = require('../index') | ||
resGetPath: 'test/locales/__lng__/__ns__.json', | ||
resSetPath: 'test/locales/__lng__/new.__ns__.json', | ||
saveMissing: false, | ||
resStore: false, | ||
@@ -51,27 +53,39 @@ returnObjectTrees: false, | ||
var spy; | ||
var spy; | ||
beforeEach(function(done) { | ||
i18n.backend(filesync); | ||
spy = sinon.spy(filesync, 'fetchOne'); | ||
i18n.init(opts, function(t) { done(); }); | ||
}); | ||
beforeEach(function(done) { | ||
i18n.backend(filesync); | ||
spy = sinon.spy(filesync, 'fetchOne'); | ||
i18n.init(opts, function(t) { done(); }); | ||
}); | ||
afterEach(function() { | ||
spy.restore(); | ||
afterEach(function() { | ||
spy.restore(); | ||
}); | ||
it('it should preload resources for languages', function(done) { | ||
spy.reset(); | ||
i18n.preload('it-IT', function(t) { | ||
expect(spy.callCount).to.be(2); // it-IT, it | ||
done(); | ||
}); | ||
it('it should preload resources for languages', function(done) { | ||
spy.reset(); | ||
i18n.preload('it-IT', function(t) { | ||
expect(spy.callCount).to.be(2); // it-IT, it | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
describe('save missing key', function() { | ||
beforeEach(function(done) { | ||
i18n.init(i18n.functions.extend(opts, { saveMissing: true }), function(t) { done(); } ); | ||
}); | ||
it('it shouldn\'t throw an error', function() { | ||
expect(i18n.t('missingTest')).to.be('missingTest'); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -17,2 +17,3 @@ var i18n = require('../index') | ||
resGetPath: 'test/locales/__lng__/__ns__.json', | ||
saveMissing: false, | ||
resStore: false, | ||
@@ -19,0 +20,0 @@ returnObjectTrees: false, |
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
870759
63
4671