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

Block Library: Translate post block placeholders. #23774

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/block-library/src/post-author/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function PostAuthorEdit( { isSelected, context, attributes, setAttributes } ) {
/>
) }
<p className="wp-block-post-author__name">
{ authorDetails?.name || 'Post Author' }
{ authorDetails?.name || __( 'Post Author' ) }
</p>
{ showBio && (
<p className="wp-block-post-author__bio">
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/post-comments-count/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useEntityId } from '@wordpress/core-data';
import { useState, useEffect } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import { addQueryArgs } from '@wordpress/url';
import { __ } from '@wordpress/i18n';

function PostCommentsCountDisplay( { className } ) {
const postId = useEntityId( 'postType', 'post' );
Expand Down Expand Up @@ -32,7 +33,7 @@ function PostCommentsCountDisplay( { className } ) {

export default function PostCommentsCountEdit( { className } ) {
if ( ! useEntityId( 'postType', 'post' ) ) {
return 'Post Comments Count';
return __( 'Post Comments Count' );
}
return <PostCommentsCountDisplay className={ className } />;
}
7 changes: 6 additions & 1 deletion packages/block-library/src/post-comments-form/edit.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

export default function PostCommentsFormEdit() {
return 'Post Comments Form';
return __( 'Post Comments Form' );
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-comments/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function PostCommentsEdit() {
// TODO: Update to handle multiple post types.
const postId = useEntityId( 'postType', 'post' );
if ( ! postId ) {
return 'Post Comments';
return __( 'Post Comments' );
}
return <PostCommentsDisplay postId={ postId } />;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-date/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function PostDateEdit( {
setAttributes,
} ) {
if ( ! useEntityId( 'postType', 'post' ) ) {
return <p>{ 'Jan 1st, 1440' }</p>;
return <p>{ __( 'Jan 1st, 1440' ) }</p>;
}
return <PostDateEditor format={ format } setAttributes={ setAttributes } />;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-excerpt/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function PostExcerptEdit( {
isSelected,
} ) {
if ( ! useEntityId( 'postType', 'post' ) ) {
return 'Post Excerpt';
return __( 'Post Excerpt' );
}
return (
<PostExcerptEditor
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/post-featured-image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { useEntityProp, useEntityId } from '@wordpress/core-data';
import { useSelect } from '@wordpress/data';
import { ResponsiveWrapper } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

function PostFeaturedImageDisplay() {
const [ featuredImage ] = useEntityProp(
Expand All @@ -28,7 +29,7 @@ function PostFeaturedImageDisplay() {

export default function PostFeaturedImageEdit() {
if ( ! useEntityId( 'postType', 'post' ) ) {
return 'Post Featured Image';
return __( 'Post Featured Image' );
}
return <PostFeaturedImageDisplay />;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/post-tags/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function PostTagsDisplay() {

export default function PostTagsEdit() {
if ( ! useEntityId( 'postType', 'post' ) ) {
return 'Post Tags';
return __( 'Post Tags' );
}
return <PostTagsDisplay />;
}
3 changes: 2 additions & 1 deletion packages/block-library/src/post-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
__experimentalBlock as Block,
} from '@wordpress/block-editor';
import { ToolbarGroup } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -66,7 +67,7 @@ export default function PostTitleEdit( {
[ `has-text-align-${ align }` ]: align,
} ) }
>
{ post.title || 'Post Title' }
{ post.title || __( 'Post Title' ) }
</Block>
</>
);
Expand Down