-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGruntfile.js
More file actions
52 lines (43 loc) · 1.19 KB
/
Gruntfile.js
File metadata and controls
52 lines (43 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module.exports = function ( grunt ) {
'use strict';
grunt.initConfig( {
addtextdomain: {
options: {
textdomain: 'gravity-forms-zero-spam',
updateDomains: []
},
target: {
files: {
src: [
'*.php',
'includes/**/*.php'
]
}
}
},
exec: {
makepot: {
cmd: function () {
var fileComments = [
'Copyright (C) ' + new Date().getFullYear() + ' GravityKit',
'This file is distributed under the GPLv2 or later',
];
var headers = {
'Last-Translator': 'GravityKit <support@gravitykit.com>',
'Language-Team': 'GravityKit <support@gravitykit.com>',
'Language': 'en_US',
'Plural-Forms': 'nplurals=2; plural=(n != 1);',
'Report-Msgid-Bugs-To': 'https://www.gravitykit.com/support',
};
var command = 'wp i18n make-pot --exclude=dist,tests,vendor . translations.pot';
command += ' --file-comment="' + fileComments.join( '\n' ) + '"';
command += ' --headers=\'' + JSON.stringify( headers ) + '\'';
return command;
}
}
}
} );
grunt.loadNpmTasks( 'grunt-exec' );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.registerTask( 'default', [ 'addtextdomain', 'exec:makepot' ] );
};