-
Notifications
You must be signed in to change notification settings - Fork 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
Framework: removed last remaining instance of SectionHeaderButton #1468
Conversation
compact> | ||
{ this.translate( 'Manage' ) } | ||
</Button> | ||
<Button |
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.
Should we make one of these a primary
one for the example?
Awesome, thanks for doing this. |
|
cc @shaunandrews as this affects #1391 |
<Button | ||
compact | ||
primary> | ||
{ this.translate( 'Primary Action' ) } |
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 could be wrong, but I don't think we need to translate the strings in examples. If we do keep the translation, we should probably at least provide some context. Maybe something like, this.translate( 'Primary Action', { context: 'Button display in documentation' } )
?
cc @deBhal who might know whether we need to translate these strings.
Note: There's also another translated string in this file on line 33
, and one more on line 45
.
I'm not sure what route to use to test this component: Code-wise, this LGTM, except comment about not using translated strings in example components, but I'm not sure which way that should go. |
Please update the examples to fit the standard, I just saw translations in one file and not the other so I made it consistent. The contexts probably make sense too. To test the domain button you have to visit a site that has a custom domain, then click on the domains sidebar item, then click on the non primary domain (i.e. example.wordpress.com) The url would be something like:
|
… forever banished that component to hell
…ixed the css to properly target Button
f718dbb
to
dde16bb
Compare
Framework: removed last remaining instance of SectionHeaderButton
I went ahead and removed the translated strings. I also was able to test that the domain management section header worked fine. 👍 |
Sorry for the late reply, I've been out of commission. These strings won't get picked up or translated, so there's no concern over wasting translator's time, it's just a matter of communications with developers. (We scan for strings after we bundle up the code, so we skip docs and tests automagically. You can always So it's just a question of whether it's better example code or not. I'd lean towards including the translate calls in general, unless you feel like they obscure the point of the example. I feel like in this example, you gain a little, particularly with the label attribute where you get a bit of extra signalling that this is a user-facing string and not a control value. I've opened PR #1536 because I feel bad about being away and missing the other PR, not to be pushy. If you feel like the example stands better without the changes, feel free to comment to that effect and close it. |
I did several things:
SectionHeaderButton
to just a compactButton
Before:
After:
cc @ebinnion @mtias @breezyskies