Closed swissspidy closed 6 years ago
I assume it is more important to have that included in the JsCodeExtractor.php
file. The code seems to be exactly the same, though:
https://github.com/wp-cli/i18n-command/blob/bd16b5fd631980dea4684e9b290b3e80674b4401/src/JsCodeExtractor.php#L111-L121
This makes me wonder again about where to DRY up the code...
This makes me wonder again about where to DRY up the code...
For reference, this is how the current makepot.php
script does it:
Right now, we exclude some files by default. One file pattern that we don't yet exclude is minified JavaScript files. They usually look like
i-am-minified.min.js
.It's not currently possible to exclude files using glob patterns like
*.min.js
but I think that would be a great addition.When someone excludes
*.min.js
, we can turn this into a regex à la.*\.min.js
or something, and then exclude the file if it matches that regex.WP_oEmbed::get_provider()
has some code that does this. Perhaps we can reuse this.In the PHP extractor, the relevant code is here: https://github.com/wp-cli/i18n-command/blob/bd16b5fd631980dea4684e9b290b3e80674b4401/src/PhpCodeExtractor.php#L129-L146
We can probably extend this with a new regex.