diff --git a/Gruntfile.js b/Gruntfile.js index 424a77e..032fe08 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 + } } }); diff --git a/package.json b/package.json index b844b61..4d30c99 100644 --- a/package.json +++ b/package.json @@ -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",