Closed claudiosanches closed 10 years ago
Hey @claudiosmweb, nice work on putting this together! I'll spend a little time trying it out and see if I can get it merged soon. Thanks!
Hey @shivapoudel, is this what you had in mind for #20?
I'll be grateful if you could give merge.
I plan to use it in WooCommerce, there have two .pot files, one for the frontend and one for the admin.
And so it is difficult to use only the exclude
.
Usage example:
makepot: {
options: {
type: 'wp-plugin',
domainPath: 'i18n/languages'
},
frontend: {
options: {
potFilename: 'woocommerce.pot',
exclude: [
'includes/admin/.*',
'apigen/.*'
],
processPot: function( pot, options ) {
pot.headers['project-id-version'] += ' Frontend';
return pot;
}
}
},
admin: {
options: {
potFilename: 'woocommerce-admin.pot',
include: [
'includes/admin/.*'
],
processPot: function( pot, options ) {
pot.headers['project-id-version'] += ' Admin';
return pot;
}
}
}
}
For that second target, have you tried excluding everything except the includes/admins
directory? I haven't test this, but maybe something like this might work:
makepot: {
options: {
type: 'wp-plugin',
domainPath: 'i18n/languages'
},
admin: {
options: {
potFilename: 'woocommerce-admin.pot',
exclude: [
'^(?!includes\/admin).*'
],
processPot: function( pot, options ) {
pot.headers['project-id-version'] += ' Admin';
return pot;
}
}
}
}
Had not thought about it yet, I'll do a test later.
But anyway, it would be interesting to have the includes
parameter, since it is already part of xgettext()
.
Cool! Thanks :)
All thanks to you for the clean PR!
I'll be very grateful if you add more this parameter :)