playground-tools
playground-tools copied to clipboard
playground block: Add initial i18n support
What?
This PR adds initial support for i18n.
I visually scanned PHP, TS, and TSX files and wrapped all the user-facing text I found with calls to __(). Because the Playground block is published under the slug interactive-code-block, that is the text domain used here.
There are a couple of tasks left:
- [ ] At least some of these need to be converted to
_x()calls to add context for translators. - [ ] There is a big block of HTML help text for "Mode" in
edit.tsxthat is not wrapped and needs more careful handling.
Testing Instructions
- Check out this branch
- Run the dev environment with
nx run wordpress-playground-block:dev - Start a new post with localhost:8881/wp-admin/post-new.php
- Insert a WordPress playground block
- Enable the Code Editor in the block's settings and poke around in other ways to make sure there are no obvious problems with user facing text.
Note: Any unrelated formatting changes are due to auto-formatting logic that runs on commit.
This PR had grown stale and is now superceded by #327.