-
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
Expanding on sentence case to everywhere else #18758
Conversation
So far we have only done this in the tooltips and in menus. If sentance case of right approach we should consider taking this across all areas. Included in this: - Side panel - Block library - Settings There may be areas missed, but gives a starting view to see if everyone agrees to go forward with this across everything. If we do, then we need a patch for core. Expands on #16764
I agree this is much better and happy to see the work that started on #16764 expand to other areas. |
@noisysocks I don't know if you can help here but the tests seem stuck again :( |
@karmatosed This time they are valid tests fails. The renaming of the default categories "Common blocks", "Layout elements", and "Reusable blocks" is causing some inserter menu test to fail. Tests at: packages/block-editor/src/components/inserter/test/menu.js Likewise with the description in this test: And label in this test: You can see the error messages here: https://travis-ci.com/WordPress/gutenberg/jobs/260658429 |
Fixes test issues.
lib/client-assets.php
Outdated
@@ -149,6 +149,14 @@ function gutenberg_override_translation_file( $file, $handle ) { | |||
} | |||
add_filter( 'load_script_translation_file', 'gutenberg_override_translation_file', 10, 2 ); | |||
|
|||
function gutenberg_override_posttype_labels( $labels ) { | |||
$labels->featured_image = 'Feaaatured image'; |
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.
looks like the macbook keyboard is not working properly :)
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.
Oops :D
c81a72f
to
c31ce37
Compare
… to conform to sentence-style capitalisation across the editor UI. (This is a quick commit to show the idea. Do expand on it and polish.) From Slack: "If we used this it would have to be properly marked [e.g. @todo] and commented so that before the next core release we could revisit these labels as a whole."
c31ce37
to
c7f1e89
Compare
* | ||
* @return object Object with all the labels, including overridden ones. | ||
*/ | ||
function gutenberg_override_posttype_labels( $labels ) { |
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.
Why do we need this function in Gutenberg?
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.
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.
Then we have to change it in Core :-)
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.
@Soean, thanks for that watchful eye. :) Indeed, we need to change it in core.
c7f1e89 was a drive-by commit to unblock Tammie. The commit message itself did mention the need to address this in core, but commit messages aren't very visible here. This all came from this thread in Slack, which also acknowledged the need to address the root cause.
The question that this commit raised is: in the interest of landing something consistent here in #18758, can we add this filter for the plugin, provided that we also open the appropriate Trac tickets?
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.
Thanks for clarification.
If a post type has a different label than "Featured image" for example "Book cover", then the filter overrides the value? This could be a problem.
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.
Yes, now it's translateable and it works for post und page post type.
So we can merge it and link it in the trac ticket, so we can remove it after merging it in core.
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.
Hi @mcsf, it seems this change needs to be backported to core. Would you be able to submit a core patch?
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.
Will do, @jorgefilipecosta.
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.
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.
Done
So far we have only done this in the tooltips and in menus. If sentance case of right approach we should consider taking this across all areas.
Included in this:
There may be areas missed but gives a starting view to see if everyone agrees to go forward with this across everything. If we do, then we need a patch for outside the editor.
Expands on #16764