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

Global Styles: Don't use named arguments for 'sprintf' #52782

Merged
merged 1 commit into from
Jul 20, 2023
Merged
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
Expand Up @@ -21,11 +21,9 @@ function getRevisionLabel( revision ) {

if ( 'unsaved' === revision?.id ) {
return sprintf(
/* translators: %(name)s author display name */
__( 'Unsaved changes by %(name)s' ),
{
name: authorDisplayName,
}
/* translators: %s author display name */
__( 'Unsaved changes by %s' ),
authorDisplayName
);
}
const formattedDate = dateI18n(
Expand All @@ -35,20 +33,16 @@ function getRevisionLabel( revision ) {

return revision?.isLatest
? sprintf(
/* translators: %(name)s author display name, %(date)s: revision creation date */
__( 'Changes saved by %(name)s on %(date)s (current)' ),
{
name: authorDisplayName,
date: formattedDate,
}
/* translators: %1$s author display name, %2$s: revision creation date */
__( 'Changes saved by %1$s on %2$s (current)' ),
authorDisplayName,
formattedDate
)
: sprintf(
/* translators: %(name)s author display name, %(date)s: revision creation date */
__( 'Changes saved by %(name)s on %(date)s' ),
{
name: authorDisplayName,
date: formattedDate,
}
/* translators: %1$s author display name, %2$s: revision creation date */
__( 'Changes saved by %1$s on %2$s' ),
authorDisplayName,
formattedDate
);
}

Expand Down Expand Up @@ -104,22 +98,14 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
<span className="edit-site-global-styles-screen-revisions__meta">
{ isUnsaved
? sprintf(
/* translators: %(name)s author display name */
__(
'Unsaved changes by %(name)s'
),
{
name: authorDisplayName,
}
/* translators: %s author display name */
__( 'Unsaved changes by %s' ),
authorDisplayName
)
: sprintf(
/* translators: %(name)s author display name */
__(
'Changes saved by %(name)s'
),
{
name: authorDisplayName,
}
/* translators: %s author display name */
__( 'Changes saved by %s' ),
authorDisplayName
) }

<img
Expand Down