Opened 8 years ago
Closed 7 years ago
#37595 closed enhancement (fixed)
Better titles for the Quick Draft dashboard widget
Reported by: | afercia | Owned by: | afercia |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-screenshots good-first-bug has-patch |
Focuses: | ui | Cc: |
Description
The "Quick Draft" dashboard widget shows the recent drafts below the form, with a title that says "Drafts":
And when JS is off, the widget hides the form and shows just the recent drafts with a "Drafts" title:
By the way, these are just the drafts created by the current user, so if there are drafts from other users, the widget will display just your ones. It's a minor thing for sure, but it's not clear at first sight because the two titles can be a bit misleading. Users may think it's a list of all the drafts (from all users), while it is not.
At the very least, I'd suggest to consider to change the two titles to make them a bit more clear. Maybe using something like "Your Recent Drafts" instead of just "Drafts".
Maybe also worth considering if limiting this list to the current user's drafts makes sense or if it should list all the drafts or maybe both types in two separated lists. Personally, I'd be in favor of keeping it simple.
Worth noting when there are more than 3 drafts from the current user, a "View all" link will appear:
and this link points to the list of drafts from all users which is OK I guess, maybe just needs to be clarified.
Feedback from the UI team more than welcome :)
Attachments (7)
Change History (20)
#3
@
8 years ago
Hi @ocean90
Can you see my patch dashboard.patch for "Quick Draft" dashboard widget shows list of draft title " Drafts "
Currently if only one draft show on site then it's so " Drafts " title.
So i write code if one draft have in site then show " Draft " title And more then one draft have then show " Drafts " title.
Tell me it's Write / Wrong think?
#4
follow-up:
↓ 5
@
8 years ago
- Keywords has-patch added
@soniakash There is _n
(https://codex.wordpress.org/Function_Reference/_n) function which allows us to use different strings based on a variable count.
I have updated your patch to use this function.
#5
in reply to:
↑ 4
@
8 years ago
Replying to sudar:
There is
_n
(https://codex.wordpress.org/Function_Reference/_n) function which allows us to use different strings based on a variable count.
It's not suitable in this case though, see https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals:
Note that some languages use the singular form for other numbers (e.g. 21, 31 and so on, much like '21st', '31st' in English). If you would like to special case the singular, check for it specifically:
if ( 1 === $count ) { printf( esc_html__( 'Last thing!', 'my-text-domain' ), $count ); } else { printf( esc_html( _n( '%d thing.', '%d things.', $count, 'my-text-domain' ) ), $count ); }
dashboard.patch is correct in that sense, although it doesn't quite do what the ticket suggests.
"My Drafts" is also an option, there's a related discussion in #26769 about "Your Profile" vs. "My Profile" (no consensus at this time though).
#6
@
8 years ago
- Version set to trunk
37595-dashboard.patch
I updated the text to read "Your Recent Draft" if there is only one draft, and "Your Recent Drafts" if there are more than one.
#7
@
8 years ago
Thanks everyone for the patches. What I was originally suggesting in this ticket wasn't about singular/plural forms but more about trying to clarify the difference between "your drafts" and "all drafts" (i.e. drafts from all users). Personally, I wouldn't be opposed to use a plural form for the title, even when there's just one draft. See screenshot below:
For sure, I'd try to clarify the "View all" link. There's an aria-label
on that link with a value View all drafts
(Note: it's not escaped 😬 ). I'd probably consider to remove the aria label and use the View all drafts
text for the link.
@
7 years ago
Change title of recent drafts section to "Your Recent Drafts" and view drafts link text to "View all drafts".
#8
@
7 years ago
Hi @afercia
I added 37595-quick-draft.patch which contains the following changes:
- Changes the title for the recent drafts section to "Your Recent Drafts".
- Changes the view drafts link text to "View all drafts". Also removes the
aria-label
on the link.
This is my first contribution so please let me know if I made any mistakes or if the patch is missing anything.
#9
@
7 years ago
@rcutmore thanks! The patch looks good to me, just one small thing:
before, this was using _x()
to specify that "View All" was about drafts:
_x( 'View all', 'drafts' )
where _x()
was used to avoid collisions with other similar strings and give translators some context to translate the string differently
Now the string is:
_x( 'View all drafts', 'drafts' )
and maybe there's no need to use _x()
and it could simply be __( 'View all drafts' )
@
7 years ago
Change title of recent drafts section to "Your Recent Drafts" and view drafts link text to "View all drafts".
#10
@
7 years ago
@afercia Thanks, that makes sense. I uploaded 37595-quick-draft.2.patch for that change.
In 38225: