Skip to content

Commit

Permalink
Localize comma separators and period
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Feb 19, 2024
1 parent a3a29a6 commit cb0f9c2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
Expand Up @@ -199,13 +199,14 @@ export default function getGlobalStylesChanges( next, previous, options = {} ) {
}, {} )
).map( ( [ key, changeValues ] ) => {
const changeValuesLength = changeValues.length;
const joinedChangesValue = changeValues.join( __( ', ' ) );
switch ( key ) {
case 'blocks': {
return sprintf(
// translators: %2$s: a list of block names separated by a comma.
_n( '%2$s block.', '%2$s blocks.', changeValuesLength ),
changeValuesLength,
changeValues.join( ', ' )
joinedChangesValue
);
}
case 'elements': {
Expand All @@ -217,25 +218,29 @@ export default function getGlobalStylesChanges( next, previous, options = {} ) {
changeValuesLength
),
changeValuesLength,
changeValues.join( ', ' )
joinedChangesValue
);
}
case 'settings': {
return sprintf(
// translators: %s: a list of theme.json setting labels separated by a comma.
__( '%s settings.' ),
changeValues.join( ', ' )
joinedChangesValue
);
}
case 'styles': {
return sprintf(
// translators: %s: a list of theme.json top-level styles labels separated by a comma.
__( '%s styles.' ),
changeValues.join( ', ' )
joinedChangesValue
);
}
default: {
return `${ changeValues.join( ', ' ) }.`;
return sprintf(
// translators: %s: a list of global styles changes separated by a comma.
__( '%s.' ),
joinedChangesValue
);
}
}
} );
Expand Down
Expand Up @@ -220,6 +220,7 @@ function RevisionsButtons( {
) : (
<Button
disabled={ areStylesEqual }
size="compact"
variant="primary"
className="edit-site-global-styles-screen-revisions__apply-button"
onClick={ onApplyRevision }
Expand Down
Expand Up @@ -148,10 +148,10 @@
.edit-site-global-styles-screen-revisions__changes {
text-align: left;
line-height: $default-line-height;
margin-left: $grid-unit-10;
margin-left: $grid-unit-15;
list-style: disc;

li {
list-style: disc;
margin-bottom: $grid-unit-05;
}
}
Expand Down
Expand Up @@ -55,13 +55,11 @@ function GlobalStylesDescription( { record } ) {
}
);
return globalStylesChanges.length ? (
<PanelRow className="entities-saved-states__change-summary">
<ul className="entities-saved-states__changes">
{ globalStylesChanges.map( ( change ) => (
<li key={ change }>{ change }</li>
) ) }
</ul>
</PanelRow>
<ul className="entities-saved-states__changes">
{ globalStylesChanges.map( ( change ) => (
<li key={ change }>{ change }</li>
) ) }
</ul>
) : null;
}

Expand Down
Expand Up @@ -20,14 +20,13 @@
font-size: $default-font-size;
}

.entities-saved-states__change-summary {
.entities-saved-states__changes {
color: $gray-700;
font-size: $helptext-font-size;
margin-left: $grid-unit-20;
margin-top: 0;
margin: $grid-unit-10 $grid-unit-20 0 $grid-unit-20;
list-style: disc;

li {
list-style: disc;
margin-bottom: $grid-unit-05;
}
}

0 comments on commit cb0f9c2

Please sign in to comment.