Skip to content

Commit

Permalink
Added i18n tools #5
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Apr 2, 2015
1 parent a86ba83 commit 9b08702
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
47 changes: 47 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,53 @@ module.exports = function( grunt ) {
dest: '<%= dirs.images %>/'
}]
}
},

// Create .pot files
makepot: {
dist: {
options: {
type: 'wp-theme'
}
}
},

// Check Text Domain
checktextdomain: {
options:{
text_domain: '<%= pkg.name %>',
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d'
]
},
files: {
src: [
'**/*.php', // Include all files
'!node_modules/**' // Exclude node_modules/
],
expand: true
}
},

// Convert .po files to .mo
po2mo: {
files: {
src: 'languages/*.po',
expand: true
}
}
});

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"grunt-contrib-sass": "~0.9.2",
"grunt-contrib-jshint": "~0.11.1",
"grunt-contrib-uglify": "~0.8.1",
"grunt-contrib-imagemin": "~0.9.4"
"grunt-contrib-imagemin": "~0.9.4",
"grunt-checktextdomain": "~1.0.0",
"grunt-wp-i18n": "~0.5.1",
"grunt-po2mo": "~0.1.2"
},
"engines": {
"node": ">=0.10.1",
Expand Down

0 comments on commit 9b08702

Please sign in to comment.