-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Post publish panel: Simplify design and follow best practices for localization #56854
Comments
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: gutenberg/packages/editor/src/components/post-publish-panel/postpublish.js Lines 104 to 105 in 16ec554
For example, when scheduling a post to be published today at a later time, More importantly, in other languages, Also, in languages other than English
|
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 #56381 (comment)
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':
gutenberg/packages/editor/src/components/post-publish-panel/postpublish.js
Lines 128 to 132 in 40c233f
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
The text was updated successfully, but these errors were encountered: