Skip to content
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

playground block: Add initial i18n support #197

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

brandonpayton
Copy link
Member

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.tsx that is not wrapped and needs more careful handling.

Testing Instructions

  1. Check out this branch
  2. Run the dev environment with nx run wordpress-playground-block:dev
  3. Start a new post with localhost:8881/wp-admin/post-new.php
  4. Insert a WordPress playground block
  5. 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.

@brandonpayton brandonpayton self-assigned this Mar 21, 2024
@brandonpayton
Copy link
Member Author

Note: Any unrelated formatting changes are due to auto-formatting logic that runs on commit.

Copy link
Collaborator

@bgrgicak bgrgicak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Playground block
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants