Open afercia opened 10 months ago
Related: #28990
Thinking at this a little more in depth, I think including the linked post title in the 'published' or 'scheduled' string does or harms than good.
When publishing or scheduling a post, the most important information I'd like to have as a used is some feedback that confirms the post has been publishedor scheduled successfully. As a used, I would benefit from that information to be prominent in the post-publish panel. Instead, what I get is the linked post title in great prominence. The 'is now live' and 'is now scheduled' parts of the string are visually less prominent and not that readable. This i smore evident when the post title is long and goes in two lines. Screenshot to illustrate:
I'd argue this isn't idea. While I understand some of the reasoning behind thie implementation, I think a clear, short, message that just informs me the publishing / scheduling was successful would be better. Im not sure the post title should be there in the first place. Also, making the post title a link seems redundant and just clutter the UI as there's a well visible 'View Post' button in the panel.
One more case: concatenating a string with a variable (in this case a component that renders different date and time in different format) is not translatable correctly:
For example, when scheduling a post to be published today at a later time, PostScheduleLabel
renders the word Today
. I'm not sure on Today
is correct English:
More importantly, in other languages, on
would need to be changed to something else or entirely omitted depending whether PostScheduleLabel
renders a date or a word like Today
. In Italian, for example, il 7 settembre
is correct but il Oggi
is totally wrong:
Also, in languages other than English on
may need to be changed to something else depending on the day number. for example, in Italian:
il 2 dicembre
is correct.il 8 dicembre
is wrong. As 8
is pronounced otto
and starts with a vocal, the article il
is incorrect. It should be: l'8 dicembre
.il 11 dicembre
is wrong as well, for the same reason.After various attempts, I realized that it's not possible to fix the translatable strings without introducing design changes. As such, I'd like to broaden the scope of this issue to propose a new, simpler, clearer, design of the publish panel. I'll update this issue title accordingly.
Description
Splitting this out from https://github.com/WordPress/gutenberg/issues/56381#issuecomment-1845056167
WordPress best practices for localization strongly recommend to avoid translatable strings that concatenate or contain variables, because the variable may differ in gender and number in languages other than English. In these cases it would be impossible to correctly translate the string.
There are several cases in the Gutenberg codebase where this recommendation is not followed. One of these cases is in the 'post publish pane':
https://github.com/WordPress/gutenberg/blob/40c233f929dc1668541a2fbd9eadd40d2b790bd0/packages/editor/src/components/post-publish-panel/postpublish.js#L128-L132
The above string can't be translated correctly. The placeholder gets replaced with the post type, which can vary in gender.
While in English 'Post address', 'Page address' or 'Product address' etc. are perfectly okay, in ohter languages translators would need to:
Indirizzo dell'articolo
Indirizzo della pagina
%s
will be replaced with.These string should:
Permalink
.Right now thie can't be translated correctly and we can't blame translators for this. Given this string:
__( '%s address' ),
translators can only translate
address
and hope that it will rok in all cases. Unfortunately, it doesn't worlThe same problem occurs when concatenating text. Concatenation should always be avoided. This is not translatable corrrectly:
https://github.com/WordPress/gutenberg/blob/trunk/packages/editor/src/components/post-publish-panel/postpublish.js/#L114-L117
because in many languages the adjectives
published
andscheduled
vary in gender depending whether the post type name is male or female.Screenshots comparing Post / Page panels in English and Italian:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes