This minimal test case shows two things concerning the gulp-wp-pot
/wp-pot
package.
If you use a translation string that has a placeholder (e.g. %s
or %1$s
) in multiple files, the plugin extracts these correctly.
But it outputs the comment for each time is was used, so there are duplicates filling up the resulting .pot file.
See result.pot
, lines 17-18.
If a translation string is used in multiple files, the filepath references are all concatenated on one line in the resulting .pot file.
It would be nice if there was an option the have them split to separate lines for readability.
In this test case I mimicked the feature using the gulp-replace
package and a 'regex -> split -> join' string replacement.
To see it in action, just uncomment lines 11 and 24 through 29 inside gulpfile.js
.