Comments (9)
This looks to be down to makepot.php, not something specific in grunt-wp-i18n. I personally don't think this option should be something that is added here, but @bradyvercher may disagree.
My suggestion would to add a grunt-contrib-replace
task that can find and remove bits from the .pot file after it has been generated.
from grunt-wp-i18n.
I went for an alternate solution, using the processPot callback:
processPot: function( pot ) {
var translation, excluded_meta = [ '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 ( typeof pot.translations[''][translation].comments.extracted != 'undefined' ) {
if ( excluded_meta.indexOf( pot.translations[''][translation].comments.extracted ) >= 0 ) {
delete pot.translations[''][translation];
console.log( 'Excluded meta: ' + pot.translations[''][translation].comments.extracted );
}
}
}
return pot;
},
Perhaps it could be added to the documentation as example.
from grunt-wp-i18n.
Adding it as a Wiki page would be a good start, then do a PR with for the README with this as an advanced example.
from grunt-wp-i18n.
I see that currently there are no wiki pages for this project and the docs are in separate files linked from the README. Should I add this at the end of makepot.md?
from grunt-wp-i18n.
Yes, that seems like the best place :-)
from grunt-wp-i18n.
I agree with Gary that an option isn't needed for this, but that's exactly what the processPot
callback is for, so I'm glad you found that useful!
Adding an advanced usage section at the bottom of makepot.md should be fine for now, but I'd be all for starting up the wiki with usage examples if someone wanted to take that on.
from grunt-wp-i18n.
Thanks for the PR, @marcochiesi!
from grunt-wp-i18n.
✋
Hey @marcochiesi great work
from grunt-wp-i18n.
This seems to be a pretty popular option, so I'm reopening for discussion on ways to make it easier to implement.
from grunt-wp-i18n.
Related Issues (20)
- Ignore certain domain (e.g. via an options.dontUpdateDomains) HOT 12
- Warning: Cannot read property 'split' of undefined HOT 6
- Exclude page templates HOT 3
- "updateTimestamp: false" is not working properly HOT 3
- Exclude doesn't included in .pot file HOT 2
- Send modified files to build path only HOT 2
- Not Working on Windows ver > 8
- Good way to eliminate duplicates in pot file HOT 8
- Running "makepot" task keeps running forever HOT 4
- update node-wp-i18n to v1.0.5 HOT 1
- updateTimestamp: false not working HOT 8
- Detecting msgid stored in variable HOT 1
- Warning: Cannot read property 'pot-creation-date' of undefined Use --force to continue. HOT 1
- POT File by text domain HOT 2
- Switch to using `wp i18n make-pot` HOT 6
- Makepot supports for monorepo plugins HOT 1
- Addtextdomain throws error HOT 1
- Better output when makepot fails due to missing PHP cli
- Warnings when running on PHP 8 HOT 2
- Duplicate text domains added where text domain already exists HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-wp-i18n.