Skip to content
Snippets Groups Projects
Commit da135fcb authored by Erick Hitter's avatar Erick Hitter
Browse files

Layout and language fixes

parent 351a3554
No related branches found
No related tags found
1 merge request!12Introduce native Gutenberg controls
......@@ -16,7 +16,6 @@ const Render = ( { limit, manualPurge, showPurgeButton, updateMeta } ) => (
title={ __( 'WP Revisions Control', 'wp_revisions_control' ) }
className={ slug }
>
{/* TODO: switch to InputControl when it becomes available. */}
<TextControl
label={ __( 'Number of revisions to retain:', 'wp_revisions_control' ) }
help={ __( 'Leave blank to keep all revisions.', 'wp_revisions_control' ) }
......@@ -36,17 +35,20 @@ const PurgeModal = ( limit, manualPurge ) => {
closeModal();
manualPurge();
};
const modalText = sprintf(
/* translators: 1. Number of revisions to keep. */
_n(
'This will remove all but the most-recent revision.',
'This will remove all but the %1$d most-recent revisions.',
parseInt( limit ),
'wp_revisions_control'
),
limit
);
const parsedLimit = parseInt( limit, 10 );
const modalText = 0 === parsedLimit
? __( 'This will remove all revisions.', 'wp_revisions_control' )
: sprintf(
/* translators: 1. Number of revisions to keep. */
_n(
'This will remove all but the most-recent revision.',
'This will remove all but the %1$d most-recent revisions.',
parsedLimit,
'wp_revisions_control'
),
limit
);
return (
<>
......@@ -64,13 +66,15 @@ const PurgeModal = ( limit, manualPurge ) => {
{ modalText }
</p>
<Button isSecondary onClick={ closeModal }>
{ __( 'Cancel', 'wp_revisions_control' ) }
</Button>
<Button isPrimary onClick={ closeModalAndPurge }>
{ __( 'Purge', 'wp_revisions_control' ) }
</Button>
&nbsp;
<Button isSecondary onClick={ closeModal }>
{ __( 'Cancel', 'wp_revisions_control' ) }
</Button>
</Modal>
) }
</>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment