-
Notifications
You must be signed in to change notification settings - Fork 34
Command Palette: Convert commands to sentence case #191
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
Conversation
@@ -56,7 +56,7 @@ function acf_commands_init() { | |||
$custom_post_types[] = array( | |||
'name' => $post_type['post_type'], | |||
'all_items' => $labels->all_items, | |||
'add_new_item' => $labels->add_new_item, | |||
'add_new_item' => ucfirst( strtolower( $labels->add_new_item ) ), |
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.
As far as I understand, RTL languages don't have upper and lower case, so this shouldn't affect them, nor would they require different treatment; is that correct, @mcsf?
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 shouldn't do this 🙈 Operations like this tend to break when applied across different languages, as they make implicit assumptions that don't always apply to all languages.
In this particular change, it breaks for German, where nouns are always capitalized: "book" is "Buch", so "Neues buch hinzufügen" would be very wrong 😬
Basically, localized strings should be left alone (which is also the reason why $labels
has so many seemingly redundant strings) -- our best course of action is to continue to use $labels->add_new_item
, and to handle the case of the strings in the individual translations.
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 Bernie, I suspected this could not play well in other languages 😅
In this case, the add_new_label
in English capitalizes both words, as seen in the Add new X
button, whereas core commands for adding new pages don't reuse strings and have their own post/page-specific strings.
My best guess here would be to add a completely new label to avoid breaking others, which aligns with the seemingly redundant strings you mentioned. Do you have any other recommendations?
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.
My best guess here would be to add a completely new label to avoid breaking others, which aligns with the seemingly redundant strings you mentioned. Do you have any other recommendations?
Do you mean a new label which would be the same as add_new_label
but with different casing expectations?
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 originally meant this, but that's before realizing core add_new_label
values have been updated in 6.8 to remove the New
part, so what we should do is change the default value for add_new_value
to align with core when creating CPTs in SCF (see #193).
Closes #190
Converts the Command Palette commands to sentence case, aligning with core commands.