diff --git a/RoboFile.php b/RoboFile.php index 44ab4e5d39..605adf88be 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -112,7 +112,8 @@ class RoboFile extends \Robo\Tasks { public function translationsBuild() { return $this->_exec('./node_modules/.bin/grunt makepot' . ' --gruntfile=' . __DIR__ . '/tasks/makepot/makepot.js' . - ' --base_path=' . __DIR__ + ' --base_path=' . __DIR__ . + ' --pot_file_name=mailpoet.pot' ); } diff --git a/tasks/makepot/makepot.js b/tasks/makepot/makepot.js index 22cf481506..2552d8a2fd 100644 --- a/tasks/makepot/makepot.js +++ b/tasks/makepot/makepot.js @@ -17,6 +17,14 @@ module.exports = function (grunt) { return; } + // get file name from options + var pot_file_name = grunt.option('pot_file_name'); + + if (pot_file_name === undefined) { + grunt.fail.fatal("Missing --pot_file_name argument"); + return; + } + // configuration. grunt.initConfig({ makepot: { @@ -35,7 +43,7 @@ module.exports = function (grunt) { 'vendor/.*' ], mainFile: 'index.php', // Main project file. - potFilename: 'mailpoet.pot', // Name of the POT file. + potFilename: pot_file_name, // Name of the POT file. potHeaders: { poedit: true, // Includes common Poedit headers. 'x-poedit-keywordslist': true // Include a list of all possible gettext functions.