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

Fix i18n issues in the block-directory package. #48158

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { _n, sprintf } from '@wordpress/i18n';
import { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';

function Stars( { rating } ) {
Expand All @@ -15,7 +15,7 @@ function Stars( { rating } ) {
<span
aria-label={ sprintf(
/* translators: %s: number of stars. */
__( '%s out of 5 stars' ),
_n( '%s star out of 5', '%s stars out of 5', stars ),
stars
) }
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';

/**
Expand All @@ -23,10 +23,13 @@ export const DownloadableBlockNotice = ( { block } ) => {
return (
<div className="block-directory-downloadable-block-notice">
<div className="block-directory-downloadable-block-notice__content">
{ errorNotice.message }
{ errorNotice.isFatal
? ' ' + __( 'Try reloading the page.' )
: null }
{ errorNotice.isFatal &&
sprintf(
/* translators: %s: Error message. */
__( '%s Try reloading the page.' ),
errorNotice.message
) }
{ ! errorNotice.isFatal && errorNotice.message }
</div>
</div>
);
Expand Down