Skip to content

Commit 6b58085

Browse files
committed
Updated to latest version of grunt-wp-i18n
1 parent 86d9471 commit 6b58085

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

config/grunt/addtextdomain.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// https://github.com/blazersix/grunt-wp-i18n
22
module.exports = {
33
options: {
4-
textdomain: '<%= pkg.plugin.textdomain %>',
5-
updateDomains: [ 'all' ]
4+
textdomain: '<%= package.textdomain %>'
65
},
76
php: {
8-
files: {
9-
src: [ '<%= files.php %>' ]
10-
}
7+
options: {
8+
updateDomains: [ 'all' ]
9+
},
10+
expand: true,
11+
src: [
12+
'<%= files.php %>'
13+
]
1114
}
1215
};

config/grunt/makepot.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,32 @@ module.exports = {
44
options: {
55
domainPath: '<%= paths.languages %>',
66
potHeaders: {
7-
poedit: true,
8-
'report-msgid-bugs-to': '<%= pkg.pot.reportmsgidbugsto %>',
9-
'last-translator': '<%= pkg.pot.lasttranslator %>',
10-
'language-team': '<%= pkg.pot.languageteam %>'
7+
'language': 'en',
8+
'plural-forms': 'nplurals=2; plural=(n != 1);',
9+
'poedit': true,
10+
'report-msgid-bugs-to': 'https://www.wpsitecare.com/contact/',
11+
'language-team': 'WP Site Care <hello@wpsitecare.com>',
12+
'last-translator': 'WP Site Care <hello@wpsitecare.com>'
13+
},
14+
processPot: function( pot ) {
15+
var translation,
16+
excludedMeta = [
17+
'Theme Name of the plugin/theme',
18+
'Theme URI of the plugin/theme',
19+
'Author of the plugin/theme',
20+
'Author URI of the plugin/theme'
21+
];
22+
23+
for ( translation in pot.translations[''] ) {
24+
if ( 'undefined' !== typeof pot.translations[''][ translation ].comments.extracted ) {
25+
if ( 0 <= excludedMeta.indexOf( pot.translations[''][ translation ].comments.extracted ) ) {
26+
console.log( 'Excluded meta: ' + pot.translations[''][ translation ].comments.extracted );
27+
delete pot.translations[''][ translation ];
28+
}
29+
}
30+
}
31+
32+
return pot;
1133
},
1234
type: 'wp-plugin'
1335
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"grunt-rtlcss": "2.x",
3131
"grunt-sass": "2.x",
3232
"grunt-version": "1.x",
33-
"grunt-wp-i18n": "0.x",
33+
"grunt-wp-i18n": "1.x",
3434
"time-grunt": "1.x"
3535
}
3636
}

0 commit comments

Comments
 (0)