forked from audiotheme/twotonefx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
46 lines (38 loc) · 1.05 KB
/
Gruntfile.js
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
/*jshint node:true */
module.exports = function( grunt ) {
'use strict';
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.initConfig({
makepot: {
plugin: {
options: {
mainFile: 'twotonefx.php',
potHeaders: {
poedit: true
},
type: 'wp-plugin',
updatePoFiles: true,
updateTimestamp: false,
processPot: function( pot ) {
var translation,
excludedMeta = [
'Plugin Name of the plugin/theme',
'Plugin URI of the plugin/theme',
'Author of the plugin/theme',
'Author URI of the plugin/theme'
];
for ( translation in pot.translations[''] ) {
if ( 'undefined' !== typeof pot.translations[''][ translation ].comments.extracted ) {
if ( 0 <= excludedMeta.indexOf( pot.translations[''][ translation ].comments.extracted ) ) {
console.log( 'Excluded meta: ' + pot.translations[''][ translation ].comments.extracted );
delete pot.translations[''][ translation ];
}
}
}
return pot;
}
}
}
}
});
};