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

Update permalink panel text to be 'View [postType]' instead of 'Preview' #16041

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

brentswisher
Copy link
Contributor

Description

Fixes #14206 by replacing the text "Preview" in the permalink panel of the document settings with "View X" where X is the post type being edited. Preview can cause some confusion as there is also a "Preview" button at the top of the settings that does something different (generates a preview) where this link is just the currently live page.

How has this been tested?

Open a Post, see it now says "View Post"
Post

Open a Page, see it now says "View Page"
Page

Enable Gutenberg's custom post type plugin, add a PublicQueryPublic custom post, see that it says "View PublicQueryPublic"
CustomPost

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

{ __( 'Preview' ) }
{ sprintf(
/* translators: %s: post type singular name */
__( 'View %s' ), postLabel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the proper view_item label for this post type as generated by get_post_type_labels in WordPress. Anything else does not translate well.

@@ -148,6 +152,7 @@ export default compose( [
postTitle: getEditedPostAttribute( 'title' ),
postSlug: getEditedPostAttribute( 'slug' ),
postID: id,
postLabel: get( postType, [ 'labels', 'singular_name' ] ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the view_item label.

@aduth
Copy link
Member

aduth commented Jun 7, 2019

Related Slack discussion concerning translatability (link requires registration):

https://wordpress.slack.com/archives/C02QB2JS7/p1558731384027700

@brentswisher
Copy link
Contributor Author

Thank you for the speedy feedback @swissspidy and @aduth! I updated to use "view_item" and added a fallback to __( 'View Post' )

Also, I had missed that slack conversation @mapk , so sorry if I stepped on your toes here

@aduth
Copy link
Member

aduth commented Jun 7, 2019

so sorry if I stepped on your toes here

No toes were stepped on! 😃

@mapk
Copy link
Contributor

mapk commented Jun 12, 2019

Also, I had missed that slack conversation @mapk , so sorry if I stepped on your toes here

No worries. Thanks for picking this up! 😄

I tested this and it works great and looks good in the UI. Let's merge this if the requests from @aduth are all good.

@gziolo gziolo added [Type] Copy Issues or PRs that need copy editing assistance [Feature] Permalink The permalink of a post or page and the experience of setting or editing it labels Jun 20, 2019
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Permalink The permalink of a post or page and the experience of setting or editing it [Type] Copy Issues or PRs that need copy editing assistance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Permalink 'Preview' to 'View' on published posts
6 participants