-
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
Editor: Add wordcount and reading time info in post card #60672
Editor: Add wordcount and reading time info in post card #60672
Conversation
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: +1.25 kB (0%) Total Size: 1.75 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.
Preemptively approved, but please see my notes :)
Yes, but the goal is to add this info in the post card. We could consider removing them from |
Co-authored-by: Miguel Fonseca <150562+mcsf@users.noreply.github.com>
@ntsekouras perhaps the wordcount/time to read should be separate from the modified date since they are not directly related: I also noticed that the ellipsis button in this panel is using the |
{ sprintf( | ||
/* translators: 1: How many words a post has (e.g. 30 words). 2: the number of minutes of read time (e.g. 2 minutes read time) */ | ||
/* translators: %1s: is the number of minutes. */ | ||
'%1$s, %2$s.', |
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.
Usually such strings just containing placeholder are not really useful for translators.
Could we maybe move it around a little bit?
%1$s. %2$s read time.
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.
Usually such strings just containing placeholder are not really useful for translators.
This was initially my suggestion, based on the idea that translators ought to decide which, if any, punctuation should best separate the two fragments. Of course, in a non-numerical setting this could all be a single string, e.g. __( '%1$s words, %2$s reading time.' )
, but since we need to take care of number agreement foremost this seemed like a reasonable concatenation technique.
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.
With something like %1$s. %2$s read time.
we can still deal with the numbers in the individual strings, e.g. %1$s
is _n( '%s word', '%s words'
and %2$s
here is _n( '%s minute', '%s minutes' )
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 updated per @swissspidy's feedback.
I'd make sure there is a clear comment for all read times. As a polyglot, I have seen too many times that translators translate e.g. "sec read" too literal. When you do that in Dutch for example, you get something like you read how many seconds it has been or you get something you expect on a report like "He has read for 5 seconds". |
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.
We can finesse the design further in follow-ups.
Thanks for updating the button size :)
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'd suggest that you make it possible for translators to assign a different value of AVERAGE_READING_RATE for their locale. Something like
//translators: This value together with the translation of xxx
_x('189', 'Value of AVERAGE_READING_RATE',...
This seems out of scope of this PR as It seems the feedback has been addressed and I'll land this. I can open a follow up if someone thinks there is a better handling of the translation message. |
What?
Part of: #59689
This PR add the wordcount and reading time info in post card, which are already part of the details view in site editor.
Testing Instructions
Screenshots or screencast