57 lines
1.1 KiB
JavaScript
57 lines
1.1 KiB
JavaScript
module.exports = function( grunt ) {
|
|
|
|
'use strict';
|
|
|
|
// Project configuration
|
|
grunt.initConfig( {
|
|
|
|
pkg: grunt.file.readJSON( 'package.json' ),
|
|
|
|
addtextdomain: {
|
|
options: {
|
|
textdomain: 'wootrain',
|
|
},
|
|
update_all_domains: {
|
|
options: {
|
|
updateDomains: true
|
|
},
|
|
src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ]
|
|
}
|
|
},
|
|
|
|
wp_readme_to_markdown: {
|
|
your_target: {
|
|
files: {
|
|
'README.md': 'readme.txt'
|
|
}
|
|
},
|
|
},
|
|
|
|
makepot: {
|
|
target: {
|
|
options: {
|
|
domainPath: '/languages',
|
|
exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ],
|
|
mainFile: 'wootrain.php',
|
|
potFilename: 'wootrain.pot',
|
|
potHeaders: {
|
|
poedit: true,
|
|
'x-poedit-keywordslist': true
|
|
},
|
|
type: 'wp-plugin',
|
|
updateTimestamp: true
|
|
}
|
|
}
|
|
},
|
|
} );
|
|
|
|
grunt.loadNpmTasks( 'grunt-wp-i18n' );
|
|
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
|
|
grunt.registerTask( 'default', [ 'i18n','readme' ] );
|
|
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
|
|
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );
|
|
|
|
grunt.util.linefeed = '\n';
|
|
|
|
};
|