From dfd8479246b51b31c825df4894f4922a50c1dd9f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 18 Mar 2013 17:58:30 +0000 Subject: [PATCH] Fix i18n for revision diff strings displaying human time. Props johnbillion fixes #23723 git-svn-id: http://core.svn.wordpress.org/trunk@23743 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 8 ++++---- wp-includes/post-template.php | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index cf6eea4ce8..a5a3a167d7 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2134,11 +2134,11 @@ function wp_ajax_revisions_data() { $compare_to_date = date_i18n( $datef, strtotime( $left_revision->post_modified ) ); $revision_from_date_author = sprintf( - '%s %s, %s %s (%s)', + /* translators: post revision title: 1: author avatar, 2: author name, 3: time ago, 4: date */ + _x( '%1$s %2$s, %3$s ago (%4$s)', 'post revision title' ), $compare_to_gravatar, $compare_to_author, human_time_diff( strtotime( $left_revision->post_modified ), current_time( 'timestamp' ) ), - __( ' ago ' ), $compare_to_date ); } @@ -2205,11 +2205,11 @@ function wp_ajax_revisions_data() { $author = get_the_author_meta( 'display_name', $revision->post_author ); $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); $revision_date_author = sprintf( - '%s %s, %s %s (%s)', + /* translators: post revision title: 1: author avatar, 2: author name, 3: time ago, 4: date */ + _x( '%1$s %2$s, %3$s ago (%4$s)', 'post revision title' ), $gravatar, $author, human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ), - __( ' ago ' ), $date ); diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index aa37a9c5e6..5d130fe208 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1317,11 +1317,11 @@ function wp_post_revision_title( $revision, $link = true ) { $date = "$date"; $revision_date_author = sprintf( - '%s %s, %s %s (%s)', + /* translators: post revision title: 1: author avatar, 2: author name, 3: time ago, 4: date */ + _x( '%1$s %2$s, %3$s ago (%4$s)', 'post revision title' ), $gravatar, $author, human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ), - __( 'ago' ), $date ); @@ -1484,12 +1484,13 @@ function wp_list_post_revisions( $post_id = 0, $args = null ) { /* translators: revision date format, see http://php.net/date */ $datef = _x( 'j F, Y @ G:i:s', 'revision date format'); $date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) ); - $timesince = human_time_diff( $restored_from_meta[ 'restored_time' ], current_time( 'timestamp' ) ) . __( ' ago ' ); + $timesince = human_time_diff( $restored_from_meta[ 'restored_time' ], current_time( 'timestamp' ) ); ?>