Closed shivapoudel closed 10 years ago
Hi @shivapoudel, I'm not sure how common it is to generate separate POT files like that, but as for the project-id-version
, hardcoding the name should be fine since that shouldn't change between builds. The version could be pulled from package.json
if needed, although I see how some of that data could be useful in the callback.
Solve like this:
// Generate POT files.
makepot: {
options: {
type: 'wp-plugin',
domainPath: 'i18n/languages',
potHeaders: {
'report-msgid-bugs-to': 'https://github.com/axisthemes/axis-framework/issues',
'language-team': 'LANGUAGE <EMAIL@ADDRESS>',
'plural-forms': 'nplurals=2; plural=n != 1;',
'language': 'en_US',
'x-poedit-sourcecharset': 'UTF-8'
}
},
frontend: {
options: {
potFilename: 'axisframework.pot',
exclude: [
'includes/config/.*',
'includes/admin/.*',
'apigen/.*'
],
processPot: function ( pot ) {
pot.headers['project-id-version'] += ' Frontend';
return pot;
}
}
},
admin: {
options: {
potFilename: 'axisframework-admin.pot',
include: [
'includes/admin/.*',
],
processPot: function ( pot ) {
pot.headers['project-id-version'] += ' Admin';
return pot;
}
}
}
},
When developer have to generate more than single
pot
files then they have to make some changes. For ease, if we want to create seperate two pot for admin interface and frontend interface for specific plugin similar likeWooCommerce
then how could we modify theproject-id-version
? Also please adapt this inpotHeaders
and make its documentation in readme soon?