-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Miscellaneous i18n fixes #66510
Miscellaneous i18n fixes #66510
Conversation
a07116c
to
2e41f78
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +302 B (+0.02%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
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've left a question inline about whether the comment style should always be /*
-- it applies in other locations but I didn't want to add too much noise to the review.
I've verified that __()
is not used in any of the files in which it's been removed from the imports.
// translators: %s: Current post parent. | ||
aria-label={ sprintf( __( 'Change parent: %s' ), parentTitle ) } | ||
aria-label={ | ||
// translators: %s: Current post parent. |
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.
Maybe???
In other locations you've changed one line translator comments to use this format, is that required here too?
// translators: %s: Current post parent. | |
/* translators: %s: Current post parent. */ |
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.
The comment style doesn't really matter. When I changed it, it was probably because of copy/paste.
// translators: %s: Current post link. | ||
aria-label={ sprintf( __( 'Change author: %s' ), authorName ) } | ||
aria-label={ | ||
// translators: %s: Author name. |
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.
As above
@@ -48,7 +48,7 @@ export function getFullPostScheduleLabel( dateAttribute ) { | |||
|
|||
const timezoneAbbreviation = getTimezoneAbbreviation(); | |||
const formattedDate = dateI18n( | |||
// translators: If using a space between 'g:i' and 'a', use a non-breaking space. | |||
// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate. |
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.
As Above
🔢 As this applies in a number of locations, I'll stop leaving as above comments everywhere. Are you able to do a search for // translators
if it needs to change.
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 Pascal.
There was a conflict while trying to cherry-pick the commit to the wp/6.7 branch. Please resolve the conflict manually and create a PR to the wp/6.7 branch. PRs to wp/6.7 are similar to PRs to trunk, but you should base your PR on the wp/6.7 branch instead of trunk.
|
Backports #66510 to the wp/6.7 branch. Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
This would be nice. It could be part of the Static Checks job. |
The catch is that it needs to run a plugin build first, as translate.wordpress.org also only runs on the built files. I built this in the past here: |
Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
What?
Fixes tons of i18n issues I encountered when running
wp i18n make-pot
, which emits warnings for cases like duplicate translator comments (indicating the need for a unique context instead) or absent translator comments (because they were not on the right line in the source code.After manually going through those issues I also noticed other bugs, for example strings that were not translatable (but even had a translator comment), like the ones introduced in ddbb8c3 over 2 years ago.
Ideally we'd run
wp i18n make-pot
on CI to continuously detect such warnings as soon as they appear. But for that we'd need something likebin/build-plugin-zip.sh
that just creates a directory that can be scanned.Why?
because i18n :)
How?
Testing Instructions
Tests should all still pass.
Testing Instructions for Keyboard
n/a
Screenshots or screencast
n/a