Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheton Wu (RD-TW) committed Mar 25, 2015
2 parents c638712 + d1e15aa commit 5d7af58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "i18next-scanner",
"version": "0.2.1",
"version": "0.3.0",
"description": "i18next-scanner is a transfrom stream that can scan your code, extract translation keys/values, and merge them into i18n resource files.",
"homepage": "https://github.com/cheton/i18next-scanner",
"author": "Cheton Wu <[email protected]>",
Expand Down Expand Up @@ -28,6 +28,8 @@
"keywords": [
"i18n",
"i18next",
"gruntplugin",
"gulpplugin",
"gettext",
"hash",
"sha1",
Expand Down
21 changes: 21 additions & 0 deletions tasks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

module.exports = function(grunt) {
var i18next = require('..');
var vfs = require('vinyl-fs');

grunt.registerMultiTask('i18next', 'A grunt task for i18next-scanner', function() {
var done = this.async();
var options = this.options() || {};
var targets = (this.file) ? [this.file] : this.files;

targets.forEach(function(target) {
vfs.src(target.files || target.src, {base: target.base || '.'})
.pipe(i18next(options, target.customTransform, target.customFlush))
.pipe(vfs.dest(target.dest))
.on('end', function() {
done();
});
});
});
};

0 comments on commit 5d7af58

Please sign in to comment.