Opened 7 years ago
Closed 7 years ago
#41150 closed enhancement (fixed)
post_categories_meta_box() function should use a taxonomy label for "Most used" tab text
Reported by: | jlambe | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | ui | Cc: |
Description
This issue is regarding the auto-generated metabox for a custom taxonomy.
When defining a custom hierarchical taxonomy in another language (in this case French), we do not have control of the text label displayed into the "Most used" tab.
When looking at source code, the first tab is calling this in order to display a custom label text for the first tab:
<?php echo $taxonomy->labels->all_items; ?>
It grabs the taxonomy labels property and use its all_items
property where the second tab is only echoing this:
<?php _e( 'Most Used' ); ?>
It could be a real enhancement to introduce a new label property for the register_taxonomy
function. Like most_used
for example so users can edit that second tab label text. With this idea, the above line code could be for this second tab:
<?php echo $taxonomy->labels->most_used; ?>
Our issue here is that the French translation is showing a female word translation (not sure how to say that in English but here is the translation "Les plus utilisées"). A user experience issue is appearing here if we define a male taxonomy name because the translation should be "Les plus utilisés".
On the other side, I do think it's not a good to globally change the Most used
text label and the idea of having a new label most_used
property per taxonomy could improve the user experience.
What do you think?
Attachments (4)
Change History (25)
#1
@
7 years ago
- Focuses accessibility removed
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to 4.9
- Version trunk deleted
#2
@
7 years ago
I think this issue about the language translation not of the coading... am i right ?
#3
@
7 years ago
- Keywords has-patch added; needs-patch removed
The patch I sent address the issue.
It is worth to note that some outputs on the post_categories_meta_box() function do not respect the late escaping policy neither escape at all.
#4
follow-up:
↓ 5
@
7 years ago
- Owner set to mdifelice
- Status changed from new to assigned
Assigning ownership to mark the good-first-bug
as "claimed".
#5
in reply to:
↑ 4
;
follow-up:
↓ 6
@
7 years ago
Replying to DrewAPicture:
Assigning ownership to mark the
good-first-bug
as "claimed".
Hi @DrewAPicture. Sorry to bother you but I am new with this. So I have a couple of questions:
- Should I assign myself the ticket in cases like this or should I wait someone to do it? Like a Core Committer?
- What should be the next steps in order to get this committed? Making tests or something else?
Thanks!
#6
in reply to:
↑ 5
@
7 years ago
Replying to mdifelice:
- Should I assign myself the ticket in cases like this or should I wait someone to do it? Like a Core Committer?
Nope! You'd just wait for a bug gardener (not all bug gardeners are committers) to assign you. The ownership field is what signifies a ticket as "claimed" on the Good First Bugs report, that's all.
- What should be the next steps in order to get this committed? Making tests or something else?
The next step is to wait for feedback from @johnbillion (who milestoned this ticket), other contributors, or any of the Taxonomy component maintainers. If, after a few days nobody has responded, you could (politely!) ping one of the maintainers on Slack to try to inspire some movement.
Hope that helps clarify the process for you :-)
#7
@
7 years ago
- Keywords needs-docs added
@mdifelice Thanks for the patch!
It is worth to note that some outputs on the post_categories_meta_box() function do not respect the late escaping policy neither escape at all.
True, but we should be strict about this with all newly added strings. (Fixing the old ones should be a separate project, and will be complicated by backward compatibility concerns.)
The approach in 41150.diff looks good. Could you please add some documentation to get_taxonomy_labes()
that describes the new string? See the function docblock for examples (both the @since
and @return
annotations), and see https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-1-parameters-that-are-arrays and https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#since-section-changelogs for more on our documentation standards. Thank you!
#8
@
7 years ago
Hi @boonebgorges. Thanks for your feedback. I sent another version. What do you think? I am not sure what to put in the @since parameter.
Regards!
#9
@
7 years ago
- Keywords needs-docs removed
@mdifelice Thanks for the quick turnaround! I'll fix the version number.
#12
@
7 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
I think this new label should have either a translators:
comment, or context via _x()
, or both.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
#15
@
7 years ago
- Owner changed from mdifelice to johnbillion
- Status changed from reopened to assigned
#17
@
7 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The same string is used without a context in wp_nav_menu_item_taxonomy_meta_box()
, for both hierarchical and non-hierarchical taxonomies.
We should either add the label for non-hierarchical taxonomies as well, or remove the context, as it just duplicates the string for no reason, causing some confusion for translators.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
#20
@
7 years ago
- Keywords good-first-bug removed
- Owner changed from johnbillion to SergeyBiryukov
- Status changed from reopened to reviewing
41150.3.diff improves the context for clarity, adds the label for non-hierarchical taxonomies too, and uses the label on the nav menus screen too.
Yep, let's do this.