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

1360 Admin amp_invalid_url table - replace 'trash' text #1408

Merged
merged 7 commits into from
Sep 7, 2018

Conversation

johnwatkins0
Copy link
Contributor

This addresses @kienstra's comments on #1360 requesting changes to the "Trash" text in the amp_invalid_url admin archive and views links.

In the archive table, the "Trash" verb is changed to "Forget." In the views links, "Trash" is changed to "Forgotten."

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about updating the post type's not_found_in_trash label as well?

get_delete_post_link( $post->ID ),
/* translators: %s: post title */
esc_attr( sprintf( __( 'Forget “%s”', 'amp' ), $post->post_title ) ),
__( 'Forget', 'amp' )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be esc_html__() instead of __()

if ( isset( $views['trash'] ) ) {
$status = get_post_status_object( 'trash' );

$views['trash'] = str_replace( $status->label, __( 'Forgotten', 'amp' ), $views['trash'] );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use esc_html__() here than __().

*
* @param array $actions The bulk actions in the edit.php page.
* @return array $actions The filtered bulk actions.
*/
public static function add_bulk_action( $actions ) {
public static function filter_bulk_actions( $actions ) {
$actions['trash'] = esc_html__( 'Forget', 'amp' );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also updating the "Move to Trash" text in the Bulk Actions select.

@@ -89,7 +89,7 @@ public static function register() {
'menu_name' => __( 'Invalid Pages', 'amp' ),
'singular_name' => __( 'Invalid AMP Page (URL)', 'amp' ),
'not_found' => __( 'No invalid AMP pages found', 'amp' ),
'not_found_in_trash' => __( 'No invalid AMP pages in trash', 'amp' ),
'not_found_in_trash' => __( 'No forgotten AMP pages', 'amp' ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be “forgotten invalid AMP pages” for now.

@westonruter
Copy link
Member

What about this success message:

image

@@ -627,7 +628,7 @@ public static function filter_row_actions( $actions, $post ) {
$actions[ self::VALIDATE_ACTION ] = sprintf(
'<a href="%s">%s</a>',
esc_url( self::get_recheck_url( $post ) ),
esc_html__( 'Re-check', 'amp' )
esc_html__( 'Recheck', 'amp' )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed hyphen from 'Re-check' for consistency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, as it seems the most commonly-accepted spelling is without the hyphen.

@@ -1045,7 +1052,7 @@ public static function print_status_meta_box( $post ) {
<div id="minor-publishing-actions">
<div id="re-check-action">
<a class="button button-secondary" href="<?php echo esc_url( self::get_recheck_url( $post ) ); ?>">
<?php esc_html_e( 'Re-check', 'amp' ); ?>
<?php esc_html_e( 'Recheck', 'amp' ); ?>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed hyphen from 'Re-check' for consistency.

/* translators: %s is the number of posts restored from trash. */
'untrashed' => _n(
'%s invalid AMP page unforgotten.',
'%s invalid AMP pages unforgotten.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“Remembered”? 😄

'deleted' => _n(
'%s invalid AMP page permanently forgotten.',
'%s invalid AMP post permanently forgotten.',
$bulk_counts['deleted'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing (and other such instances): this could be wrapped in number_format_i18n().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, core isn't doing it. So no need for it here.

@westonruter westonruter added this to the v1.0 milestone Sep 7, 2018
@westonruter westonruter merged commit 4015913 into develop Sep 7, 2018
@westonruter westonruter deleted the update/1360-trash-text branch September 7, 2018 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants