node-gettext
Advanced tools
Comparing version 1.0.1 to 1.1.0
# Changelog | ||
## v1.1.0 | ||
* Adds support for adding a textdomain from an already parsed json object | ||
## v1.0.0 2015-01-21 | ||
@@ -4,0 +8,0 @@ |
@@ -29,3 +29,6 @@ 'use strict'; | ||
if (file && typeof file !== 'string') { | ||
if (file && file.translations) { | ||
translation = file; | ||
} | ||
else if (file && typeof file !== 'string') { | ||
translation = gettextParser.mo.parse(file, 'utf-8'); | ||
@@ -32,0 +35,0 @@ } |
{ | ||
"name": "node-gettext", | ||
"description": "Gettext client for Node.js to use .mo files for I18N", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"author": "Andris Reinman", | ||
"maintainers": [{ | ||
"name": "andris", | ||
"email": "andris@node.ee" | ||
}], | ||
"maintainers": [ | ||
{ | ||
"name": "andris", | ||
"email": "andris@node.ee" | ||
} | ||
], | ||
"homepage": "http://github.com/andris9/node-gettext", | ||
@@ -19,15 +21,18 @@ "repository": { | ||
"main": "./lib/gettext", | ||
"licenses": [{ | ||
"type": "MIT", | ||
"url": "http://github.com/andris9/node-gettext/blob/master/LICENSE" | ||
}], | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://github.com/andris9/node-gettext/blob/master/LICENSE" | ||
} | ||
], | ||
"dependencies": { | ||
"gettext-parser": "^1.1.0" | ||
"gettext-parser": "^1.1.2" | ||
}, | ||
"devDependencies": { | ||
"chai": "^1.10.0", | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"chai": "^3.5.0", | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-contrib-jshint": "^1.0.0", | ||
"grunt-mocha-test": "^0.12.7", | ||
"mocha": "^2.1.0" | ||
"mocha": "^2.4.5" | ||
}, | ||
@@ -34,0 +39,0 @@ "engine": { |
@@ -48,5 +48,2 @@ # node-gettext | ||
If you do not include the file contents, then a blank language template object | ||
is created which can be edited with *setTranslation*, *deleteTranslation* methods etc. | ||
Plural rules are automatically detected from the language code | ||
@@ -53,0 +50,0 @@ |
@@ -43,2 +43,12 @@ 'use strict'; | ||
it('Should add from a json file', function() { | ||
var gt = new Gettext(); | ||
var jsonFile = JSON.parse(fs.readFileSync(__dirname + '/fixtures/latin13.json')); | ||
gt.addTextdomain('et-EE', jsonFile); | ||
expect(gt.domains.et_EE).to.exist; | ||
expect(gt.domains.et_EE.charset).to.equal('iso-8859-13'); | ||
}); | ||
}); | ||
@@ -45,0 +55,0 @@ |
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
74956
14
2551
6
130
Updatedgettext-parser@^1.1.2