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