Skip to content

Commit c4b3379

Browse files
committed
Allow --add-location parameter
Allow usage of the --add-location parameter. By default, the location consists of a hash, colon, file name and line number. In more recent versions of xgettext, this can be altered to 'none' or 'file'. The default value is 'full', but this is implied when the parameter is missing. I want to remove the line numbers from the .pot-file, because they change frequently and this causes differences in the .pot-file that are not really changes, but do show op in the versioning system each time.
1 parent 76a4b38 commit c4b3379

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tasks/pot.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = function(grunt) {
2323
language: false,
2424
encoding: false,
2525
text_domain: 'messages',
26+
add_location: false,
2627
package_version: pkg.version,
2728
package_name: pkg.name,
2829
msgid_bugs_address: false,
@@ -57,6 +58,9 @@ module.exports = function(grunt) {
5758

5859
//Set input files encoding, if required
5960
var encoding = ( options.encoding ? " --from-code="+options.encoding : "" );
61+
62+
// Set location format (default: full)
63+
var add_location = ( options.add_location ? " --add-location="+options.add_location : "" );
6064

6165
//Generate header
6266
if( options.package_version ){
@@ -92,7 +96,7 @@ module.exports = function(grunt) {
9296

9397
//Compile and run command
9498
var exec = require('child_process').exec;
95-
var command = 'xgettext' + join + ' --default-domain=' + options.text_domain + ' -o '+potFile + language + encoding + keywords + headerOptions + inputFiles;
99+
var command = 'xgettext' + join + ' --default-domain=' + options.text_domain + ' -o '+potFile + language + encoding + keywords + add_location + headerOptions + inputFiles;
96100
var done = grunt.task.current.async();
97101

98102
grunt.verbose.writeln('Executing: ' + command);

0 commit comments

Comments
 (0)