-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add a "translators:" comment in the core class used to implement a Block widget #34840
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @amieiro! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
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.
Sounds good to me.
@talldan @draganescu for awareness (I'll merge tomorrow if no one brings up anything).
lib/class-wp-widget-block.php
Outdated
@@ -197,6 +197,7 @@ public function form( $instance ) { | |||
$instance = wp_parse_args( (array) $instance, $this->default_instance ); | |||
?> | |||
<p> | |||
/* translators: HTML code of the block, not an option that blocks HTML */ |
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 the PR!
I don't think this exact code would work, as we're inserting a PHP comment inside an HTML <p>
tag.
We can also replace echo __()
with _e()
while we're at it.
I would suggest something like this to match a similar change for WordPress core in r51814:
<label for="<?php echo $this->get_field_id( 'content' ); ?>">
<?php
/* translators: HTML code of the block, not an option that blocks HTML. */
_e( 'Block HTML:', 'gutenberg' );
?>
</label>
Following the commit integrated in the WordPress core https://core.trac.wordpress.org/changeset/51814 I move the comment near the text to be translated and update the translation function used
Congratulations on your first merged pull request, @amieiro! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
This comment is intended to facilitate the translation of the plugin, which is incorporated in the WordPress core, so that its translation is not ambiguous.
See https://core.trac.wordpress.org/ticket/54110
This PR has been sent to WordPress develop. See this PR.
Description
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).