Comparing version 1.3.3 to 1.3.4
@@ -48,28 +48,28 @@ var fs = require('fs'); | ||
postChange: function(ns, lng, key, newValue) { | ||
var self = this; | ||
this.load([lng], {ns: {namespaces: [ns]}}, function(err, fetched) { | ||
// change key in resStore | ||
var keys = key.split('.'); | ||
var x = 0; | ||
var value = fetched[lng][ns]; | ||
while (keys[x]) { | ||
if (x === keys.length - 1) { | ||
value = value[keys[x]] = newValue; | ||
} else { | ||
value = value[keys[x]] = value[keys[x]] || {}; | ||
// change key in resStore | ||
var keys = key.split('.'); | ||
var x = 0; | ||
var value = fetched[lng][ns]; | ||
while (keys[x]) { | ||
if (x === keys.length - 1) { | ||
value = value[keys[x]] = newValue; | ||
} else { | ||
value = value[keys[x]] = value[keys[x]] || {}; | ||
} | ||
x++; | ||
} | ||
x++; | ||
} | ||
var filename = this.functions.applyReplacement(this.resSetPath, {lng: lng, ns: ns}); | ||
var filename = self.functions.applyReplacement(self.options.resSetPath, {lng: lng, ns: ns}); | ||
var self = this; | ||
fs.writeFile(filename, JSON.stringify(fetched[lng][ns], null, 4), function (err) { | ||
if (err) { | ||
self.functions.log('error updating key `' + key + '` with value `' + newValue + '` to: ' + filename); | ||
} else { | ||
self.functions.log('updated key `' + key + '` with value `' + newValue + '` to: ' + filename); | ||
} | ||
fs.writeFile(filename, JSON.stringify(fetched[lng][ns], null, 4), function (err) { | ||
if (err) { | ||
self.functions.log('error updating key `' + key + '` with value `' + newValue + '` to: ' + filename); | ||
} else { | ||
self.functions.log('updated key `' + key + '` with value `' + newValue + '` to: ' + filename); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
}; |
(function() { | ||
// when updating i18next dep update version here | ||
var i18nVersion = '1.3.1'; | ||
var i18nVersion = '1.3.4'; | ||
@@ -6,0 +6,0 @@ var i18n = require('./dep/i18next-' + i18nVersion) |
@@ -5,3 +5,3 @@ { | ||
"description": "i18n made easy - full featured: middleware, template support plus clientside use", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
62465
23
1281
1