Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a script that creates a PHP file based on a POT #5310
This is a workaround to make Gutenberg translatable. translate.wordpress.org ignores the POT file provided by the plugin and parser the PHP file itself. We can work around this by providing a PHP file generated on the POT file.
How Has This Been Tested?
I've copied the code from wordpress-seo and adapted it for a non-grunt environment. So the code has been tested by wordpress-seo. I've run it once to see that it generates something sensible.
The real tests can only be done once it is on translate.wordpress.org. Which this PR + a release will accomplish.
See #5169. Note that this PR is the short-term solution.
I've fixed most of the comments, @aduth.
In this paragraph:
What do you mean with
For the purposes of string extraction, "
We still want the text of the comments represented via
I don't think there is a way to tell the PHP parser that the reference to the file should be different. I think it would be confusing if we put that in the translator comment. So we have to make do with translators going to the PHP file then discovering that they need to go to the JS file. #5169 is the correct solution for this.
I will address
Looks like recent changes might have broken the formatting of the PHP output. Reference comments are no longer on their own lines.