Skip to content
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

Merged
merged 13 commits into from Dec 16, 2019
Merged

Conversation

@karmatosed
Copy link
Member

karmatosed commented Nov 26, 2019

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 outside the editor.

Expands on #16764

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
@karmatosed

This comment has been minimized.

Copy link
Member Author

karmatosed commented Nov 26, 2019

Some images with these changes:

image

image

image

karmatosed added 2 commits Nov 26, 2019
@enriquesanchez

This comment has been minimized.

Copy link
Contributor

enriquesanchez commented Nov 26, 2019

I agree this is much better and happy to see the work that started on #16764 expand to other areas.

@karmatosed

This comment has been minimized.

Copy link
Member Author

karmatosed commented Dec 2, 2019

@noisysocks I don't know if you can help here but the tests seem stuck again :(

@mkaz

This comment has been minimized.

Copy link
Member

mkaz commented Dec 9, 2019

@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:
FAIL packages/edit-post/src/components/keyboard-shortcut-help-modal/test/index.js

And label in this test:
FAIL packages/edit-post/src/components/options-modal/test/index.js

You can see the error messages here: https://travis-ci.com/WordPress/gutenberg/jobs/260658429

Fixes test issues.
@karmatosed karmatosed requested a review from noisysocks as a code owner Dec 10, 2019
karmatosed added 3 commits Dec 10, 2019
karmatosed added 2 commits Dec 10, 2019
@karmatosed karmatosed requested a review from TimothyBJacobs as a code owner Dec 11, 2019
@@ -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';

This comment has been minimized.

Copy link
@youknowriad

youknowriad Dec 11, 2019

Contributor

looks like the macbook keyboard is not working properly :)

This comment has been minimized.

Copy link
@mcsf

mcsf Dec 11, 2019

Contributor

Oops :D

@mcsf mcsf force-pushed the try/sentance-everywhere branch from c81a72f to c31ce37 Dec 11, 2019
… 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."
@mcsf mcsf force-pushed the try/sentance-everywhere branch from c31ce37 to c7f1e89 Dec 11, 2019
lib/client-assets.php Outdated Show resolved Hide resolved
*
* @return object Object with all the labels, including overridden ones.
*/
function gutenberg_override_posttype_labels( $labels ) {

This comment has been minimized.

Copy link
@Soean

Soean Dec 11, 2019

Member

Why do we need this function in Gutenberg?

This comment has been minimized.

Copy link
@karmatosed

karmatosed Dec 12, 2019

Author Member

@Soean the problem is that our labels come from core so we can't have sentence case without. I will loop @mcsf in here as they worked on this solution to help.

This comment has been minimized.

Copy link
@Soean

Soean Dec 12, 2019

Member

Then we have to change it in Core :-)

This comment has been minimized.

Copy link
@mcsf

mcsf Dec 12, 2019

Contributor

@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?

This comment has been minimized.

Copy link
@Soean

Soean Dec 12, 2019

Member

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.

This comment has been minimized.

Copy link
@mcsf

mcsf Dec 12, 2019

Contributor

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.

This change is only targeting post and page post types. Do you think that, even then, we should guard against potential customisations? Something like:

if ( __( 'Featured Image' ) == $labels->featured_image ) {
  $labels->featured_image = __( 'Featured image', 'gutenberg' );
}
return $labels;

This comment has been minimized.

Copy link
@karmatosed

karmatosed Dec 16, 2019

Author Member

@Soean can you confirm if what @mcsf has done is ok for now? I will happily make a trac ticket, but it would be good to get a start on things in Gutenberg here.

This comment has been minimized.

Copy link
@Soean

Soean Dec 16, 2019

Member

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.

mcsf and others added 3 commits Dec 12, 2019
@karmatosed karmatosed merged commit ab8af23 into master Dec 16, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@karmatosed karmatosed deleted the try/sentance-everywhere branch Dec 16, 2019
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.