-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i18n extractor: extract strings from Gutenberg Blocks. #10391
Conversation
Currently this does not quite work. The strings generated in the
|
This is automated check which relies on Generated by 🚫 dangerJS |
This is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work well in my tests! 🎉
@jeherve I'll ping in Slack. I'm seeing errors when trying to run through your testing steps, so want to confirm if it is me or the PR. Let's hold on to make sure it is just me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some issues with Calypso due to stale node_modules
and in the course of figuring that out, I upgraded node to 11.0.0. The gulp function didn't work as expected under Node 11, but a downgrade to 10.11.0 + rebuild node-sass resolved that.
Once I got the environment working, tests as expected. 🚢
- Allow the `gulp languages:extract` task to get the strings from any .js files in the `_inc/blocks` directory. This is currently where we place the Gutenberg Block files generated by the SDK.
8deb5d0
to
b9d21d9
Compare
Folks, this needs another review because we fixed something we missed: Automattic/wp-calypso#28088 (comment) Note that I've rebased this branch, so you might want to pull the latest rebased version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for landing this one, folks! Note that the Calypso PR still needs to land before we're able to index translations from blocks: Automattic/wp-calypso#28088 |
Changes proposed in this Pull Request:
This changes the
gulp languages:extract
task so it can get the strings from any .js files in the_inc/blocks
directory. This is currently where we place the Gutenberg Block files generated by the SDK.In addition, the task now searches for
_n()
,_x()
and_nx()
, so we can account for any@wordpress/i18n
localization function.Testing instructions:
remove/gutenberg-jetpack-textdomain
- (Calypso PR)where
DIR_TO_JETPACK
is the directory to your local Jetpack repo.gulp
globally installed.gulp languages:extract
_inc/jetpack-strings.php
contains new strings, coming from any of the .js block files (towards the end of the file).Proposed changelog entry for your changes: