#44360 closed task (blessed) (fixed)
Missing translators comment need to be added
Reported by: | jrf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | minor | Version: | 5.1 |
Component: | I18N | Keywords: | good-first-bug has-patch |
Focuses: | coding-standards | Cc: |
Description
There are a large number of translatable strings in WP Core which contain placeholders, but do not have a /* translators: ... */
comment.
For some, it may be obvious what string is expected if you know the code and/or are a native English speaker, but for a lot of translators, neither is the case, so all those strings should be accompanied by a translators comment.
The list of issues as per June 11th 2018 can be found here: https://gist.github.com/jrfnl/2eb01256bc8548af14df719bdc168fcb
Patches against this ticket should be uploaded one patch per fixed core file.
This ticket is a focus area for the WCEU 2018 contributors day.
Attachments (60)
Change History (121)
#1
@
6 years ago
@subrataemfluence Thanks for those patches. Be aware that we have a coordinated effort here at WCEU Contributor Day - please see the #core-coding-standards channel on Slack for who is doing which batch of files.
@
6 years ago
Fixes WordPress.WP.I18n violations in src/*.php files - replacement that excludes wp-admin/update.php
#2
@
6 years ago
Some of the translator comments are inconsistent.
For example, there's translators: %s: search keywords
and also translators: %s is the WordPress version number
.
IIRC core only uses the former style everywhere, so translators: %s is the WordPress version number
should really be translators: %s: WordPress version number
.
Also, some of the newer patches are already covered by the ones covering multiple directories.
#5
@
6 years ago
I've reviewed the 44360.wp-includes_theme_compat.patch by @marcomartins, it seems to be ok.
#6
@
6 years ago
I reviewed the comitted files in wp-admin_root_directory_1_of_2.diff of @webdados and I noted some comments to fix. I agree with @swissspidy about the standard, and @webdados are doing it.
#7
@
6 years ago
I've reviewed 44360.wp-includes_rest-api.patch by @marcomartins and suggest the following changes:
class-wp-rest-request.php
lines 806, 888: /* translators: %s: list of invalid parameters */
line 852: /* translators: %s: list of required parameters */
class-wp-rest-comments-controller.php
line 158: /* translators: %s: list of forbidden parameters */
class-wp-rest-settings-controller.php
line 193: /* translators: %s: property name */
#8
@
6 years ago
I've reviewed /44360.wp-includes_customize.2.patch by @marcomartins and suggest the following changes:
class-wp-customize-header-image-control.php
line 182: /* translators: %s: is the header size in pixels */
class-wp-customize-nav-menu-locations-control.php
line 78: /* translators: %s: is the menu name */
class-wp-customize-themes-section.php
line 91: /* translators: %s: is the "Search WordPress.org themes" button text */
#10
@
6 years ago
I've reviewed @niq1982 wp-admin-network.diff and I suggest to remove the point from the end of the translators comment.
#12
@
6 years ago
I've reviewed 44360-wp-admin-includes-dir.patch by @flipkeijzer and it seems to be OK.
#13
@
6 years ago
I've reviewed 44360/wp-admin_root.diff by @webdados and suggest the following changes:
wp-admin/async-upload.php
Line 95: /* translators: %s: name of file that failed to upload. */
wp-admin/edit-form-advanced.php
Lines 172, 187: /* translators: %s: date the page is scheduled to be published */
wp-admin/edit-link-form.php
Lines 15, 21: /* translators: %s: link to the Links Manager */
wp-admin/freedoms.php
Line 44: /* translators: %s: link to the stats page on wordpress.org */
Line 47: /* translators: %s: link to the privacy page on wordpress.org */
Line 53: /* translators: %s: link to the license page on wordpress.org */
wp-admin/import.php
Line 219: /* translators: %s: link to the plugin directory */
wp-admin/link-manager.php
Line 55: /* translators: %s: link to the widgets page */
wp-admin/plugin-install.php
Line 86: /* translators: %s: link to the plugin directory on wordpress.org */
wp-admin/plugins.php
Line 482: /* translators: %d: number of unexpected outputed characters */
wp-admin/widgets.php
Line 296: /* translators: %s: widget name */
#14
@
6 years ago
@alvarogois Although most suggested changes are merely semantic, I'll upload a new diff file with the suggested changes
Thanks for the review
This ticket was mentioned in Slack in #core-coding-standards by flipkeijzer. View the logs.
6 years ago
#16
@
6 years ago
In the wp i18n make-pot
command to create POT files for WordPress plugins and themes, but also WordPress core, I added a check to find strings with multiple different translator comments. I also added some other checks that I copied from WPCS (kudos!).
This is usually an indicator that these should be multiple strings with different contexts or that the translator comments should be unified. Otherwise translators will see multiple comments in GlotPress when trying to translate a string.
For example, the string More information about %s
exists three times in WordPress core. Once, the translator comment is %s: plugin name and version
, the second time it's %s: Importer name
and in the third instance there's no comment at all.
Here are the current warnings for WordPress 4.9.8: https://gist.github.com/swissspidy/006e26b7ba53cdb68a5d10763d8fcc31
#20
@
6 years ago
Reviewed
- https://core.trac.wordpress.org/attachment/ticket/44360.admin-footer.diff
- https://core.trac.wordpress.org/attachment/ticket/44360.admin.php.diff
- https://core.trac.wordpress.org/attachment/ticket/44360.comment.php.diff
by @subrataemfluence and all three seem fine
there is a grammar error in there:
/* translators: %s: Name of the file that was failed to upload. */
should be
/* translators: %s: Name of the file that has failed to upload. */
#22
@
6 years ago
Reviewed https://core.trac.wordpress.org/attachment/ticket/44360/44360.wp-includes_theme_compat.patch and following @swissspidy 's comment I suggest these change:
wp-includes/theme-compat/sidebar.php
line 45 /* translators: %s: the category name */
#23
@
6 years ago
@marcomartins is https://core.trac.wordpress.org/attachment/ticket/44360/44360.wp-includes_theme_compat.2.patch the successor of https://core.trac.wordpress.org/attachment/ticket/44360/44360.wp-includes_theme_compat.patch
https://core.trac.wordpress.org/attachment/ticket/44360/44360.wp-includes_theme_compat.2.patch suggested change add line 106 to wp-includes/theme-compat/sidebar.php
106 /* translators: 1: URL to blog; 2: Name of blog. */
107 sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) )
#25
follow-up:
↓ 26
@
6 years ago
@FesoVik I appreciate your enthousiasm to contribute to this ticket.
The existing patches cover most files already. Please check that you're not doing double work before creating a patch.
#26
in reply to:
↑ 25
@
6 years ago
Replying to jrf:
@FesoVik I appreciate your enthousiasm to contribute to this ticket.
The existing patches cover most files already. Please check that you're not doing double work before creating a patch.
Thank you for the reply. I am following the gist file and only doing those that are not yet done.
#27
follow-up:
↓ 28
@
6 years ago
@FesoVik That gist is from June and does not contain the patches which have been uploaded here...
#28
in reply to:
↑ 27
@
6 years ago
Replying to jrf:
@FesoVik That gist is from June and does not contain the patches which have been uploaded here...
Yes, I am aware. I did not find any submitted patches for the files I just uploaded.
#31
follow-up:
↓ 32
@
6 years ago
@tessak22 The "menus widget:" part is not needed in the translator comment.
@bhaktirajdev Please note that your patch is incorrect in a few ways.
First of all, /* translators: %s: Welcome message */
and /* translators: %s: Thank You message for latest version updation */
are wrong. The translator comment should describe the placeholder. Adding a comment like "Welcome message" to "Welcome to WordPress %s" is not really helpful :-) I think everyone gets that it's a welcome message.
Second, the comments need to be in the PHP part of file and directly precede the line of the __()
function calls. See 44360.about.php.diff for a correct example.
#32
in reply to:
↑ 31
@
6 years ago
Replying to swissspidy:
@swissspidy Thank you for your guidance. It should be in PHP part of the file - completely overlooked it in excitement of contributing first time. Also noted the point - comment should describe the placeholder. Thanks for the help :)
@tessak22 The "menus widget:" part is not needed in the translator comment.
@bhaktirajdev Please note that your patch is incorrect in a few ways.
First of all,
/* translators: %s: Welcome message */
and/* translators: %s: Thank You message for latest version updation */
are wrong. The translator comment should describe the placeholder. Adding a comment like "Welcome message" to "Welcome to WordPress %s" is not really helpful :-) I think everyone gets that it's a welcome message.
Second, the comments need to be in the PHP part of file and directly precede the line of the
__()
function calls. See 44360.about.php.diff for a correct example.
#34
@
6 years ago
Note that the latest two patches for about.php
are incorrect. The translator comments should describe the %s
placeholders in the message, not the message itself.
#36
@
6 years ago
@jrf @swissspidy Are you able to summarize what is left or commit the rest here for 5.1?
This ticket was mentioned in Slack in #core by paolacantadore2018. View the logs.
6 years ago
#38
@
6 years ago
- Owner set to jrf
- Status changed from new to assigned
@desrosj Status summary:
- All patches created at WCEU have been reviewed for i18n correctness. Those patches have priority.
- They do still need to be reviewed for CS in general and where necessary updated.
- I had only just started updating and committing the WCEU patches when trunk got closed.
- Now trunk is open again, I expect a lot of patches won't go in clean anymore, aside from chances being that new patches for newly introduced issues may be needed.
- It's on my things to list, but what with all the updates needed, it's not a small job, so trying to find the time.
- All other patches should only be reviewed once the WCEU patches have gone in to see if they are still needed.
For my planning: What's the cut-off date for WP 5.1 ?
#39
@
6 years ago
- Type changed from enhancement to task (blessed)
February 7 is the hard string freeze for 5.1, that's the latest possible date for committing these. As they're translator comments, I'm fine with them being committed across the beta period.
I've converted this ticket to a task to reflect that.
#40
@
6 years ago
@jrf: The soft string freeze is January 29, are you likely to be able to work on this before then?
#41
@
6 years ago
As long as only the translator comments are changed and not the strings themselves, this shouldn‘t be a problem for string freeze because no translations should get fuzzied that way.
#42
@
6 years ago
@pento @swissspidy It's on my radar and I'll try to get to it before the end of the month.
Most of my focus is currently on a major code refactor for PHPCS 3.5.0 which has some time pressure too, so trying to juggle things.
#43
@
6 years ago
I'd like to help committing the patches but it's unclear what patches need to be committed. I think a spreadsheet might help here which for example marks WCEU patches as such. Does something like this already exist somewhere?
@
6 years ago
Adds translator comments to class-wp-users-list-table.php similar to those done by @FesoVik on class-wp-ms-users-list-table.php
#44
@
6 years ago
- Milestone changed from 5.1 to 5.2
With RC1 approaching, I'm moving this to 5.2 for continued work.
#45
@
6 years ago
Hi, WordPress community. I made a spreadsheet (using @ocean90 's suggestion) while I sorted through the submitted and reviewed patches trying to determine what still remains. You can find it here if you're interested: https://github.com/SoCalChristina/DjcdUOR26wAZUIuPcdIyAO
Cheers
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
6 years ago
#47
@
6 years ago
- Milestone changed from 5.2 to 5.3
Per input from @jrf in Slack, we're going to punt this to 5.3 to work through remaining updates then.
This ticket was mentioned in Slack in #core by 5hel2l2y. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-i18n by 5hel2l2y. View the logs.
5 years ago
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
5 years ago
#53
@
5 years ago
I regenerated the list of issues with PHPCS to help in the effort to align with patches:
Summary: https://gist.github.com/adamsilverstein/f8e3b84902d8452b6e6e2a3c0f618331
Complete report: https://gist.github.com/adamsilverstein/969ab73a5a0c18de60c6c83eeeb3b0c7
I used the following commands to generate thes, hope thats right:
./vendor/bin/phpcs src/*.php src/**/*.php --standard=WordPress --sniffs=WordPress.WP.I18n --report=summary
./vendor/bin/phpcs src/*.php src/**/*.php --standard=WordPress --sniffs=WordPress.WP.I18n
#54
@
5 years ago
Thanks for the updated output noting remaining issues to fix @adamsilverstein!
I've gone updated the spreadsheet that @socalchristina created, turned it into a Google Sheet, and brought it current with the list of issues that @adamsilverstein pulled above and with the lastest patches.
Notes on the Google Sheet:
1) Core file
links to the specific output for each core file
2) .patch/.diff file
links to any existing patches for that core file
3) Committed
notes whether said patch has been committed
4) Contributor
notes who contributed said patch
5) Review/Reply
columns note who's reviewed said patch and which comment on this ticket the review came from
Note for folks looking to contribute additional patches:
- Please focus on rows where the
.patch/.diff file
column is empty as that means no one else has submitted a patch for that core file yet
Note for folks looking to review patches:
- Please focus on rows where there is an existing
.patch/.diff file
but theReview/Reply
is empty
Note for committers:
- Please focus on patches in rows where there is an existing
Review/Reply
noted, though you'll want to double check the linked review comment to ensure the patch was marked as "OK" and not a comment requesting a refresh
I've given @jrf and @socalchristina edit rights to the Google Sheet (and can grant others as well), but I'll attempt to update the Google Sheet so that its current for any contributors, reviewers, or committers looking for a current status on this ticket.
Patch for admin-footer.php