diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 0be300caf..e8dcbbbc9 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -869,7 +869,9 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() $do_lock = true; $data = ''; - $message = sprintf( __('Draft Saved at %s.'), date_i18n( __('g:i:s a') ) ); + /* translators: draft saved date format, see http://php.net/date */ + $draft_saved_date_format = __('g:i:s a'); + $message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) ); $supplemental = array(); @@ -1200,6 +1202,7 @@ case 'find_posts': if ( '0000-00-00 00:00:00' == $post->post_date ) { $time = ''; } else { + /* translators: date format in table columns, see http://php.net/date */ $time = mysql2date(__('Y/m/d'), $post->post_date); } diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 42cd3df02..4a83dd65c 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -171,7 +171,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + comments_number("" . /* translators: comment count link */ _x('0', 'comment count') . '', "" . /* translators: comment count link */ _x('1', 'comment count') . '', "" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . ''); if ( $left ) echo ''; ?> diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index f95b08716..024625be0 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -184,104 +184,104 @@ function link_xfn_meta_box($link) { ?> - +
- - + - - + - - + - - + - - + - - + - - +
+
+
+ /> + /> + /> + />
+
+
+
+ +
+
+ + +
+
+ + + + + +
+
+ + + +
diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index 55321f44e..884309282 100644 --- a/wp-admin/edit-pages.php +++ b/wp-admin/edit-pages.php @@ -75,11 +75,11 @@ $parent_file = 'edit-pages.php'; wp_enqueue_script('inline-edit-post'); $post_stati = array( // array( adj, noun ) - 'publish' => array(__('Published|page'), __('Published pages'), _n_noop('Published (%s)|page', 'Published (%s)')), - 'future' => array(__('Scheduled|page'), __('Scheduled pages'), _n_noop('Scheduled (%s)|page', 'Scheduled (%s)')), - 'pending' => array(__('Pending Review|page'), __('Pending pages'), _n_noop('Pending Review (%s)|page', 'Pending Review (%s)')), - 'draft' => array(__('Draft|page'), _c('Drafts|manage posts header'), _n_noop('Draft (%s)|page', 'Drafts (%s)')), - 'private' => array(__('Private|page'), __('Private pages'), _n_noop('Private (%s)|page', 'Private (%s)')) + 'publish' => array(_x('Published', 'page'), __('Published pages'), _nx_noop('Published (%s)', 'Published (%s)', 'page')), + 'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled (%s)', 'Scheduled (%s)', 'page')), + 'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _n_noop('Pending Review (%s)', 'Pending Review (%s)', 'page')), + 'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft (%s)', 'Drafts (%s)', 'page')), + 'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private (%s)', 'Private (%s)', 'page')) ); $query = array('post_type' => 'page', 'orderby' => 'menu_order title', 'what_to_show' => 'posts', @@ -160,7 +160,7 @@ foreach ( $post_stati as $status => $label ) { if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] ) $class = ' class="current"'; - $status_links[] = "
  • " . sprintf( _nc( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . ''; + $status_links[] = "
  • " . sprintf( _nx( $label[2][0], $label[2][1], $num_posts->$status, $label[2][2] ), number_format_i18n( $num_posts->$status ) ) . ''; } echo implode( " |
  • \n", $status_links ) . ''; unset($status_links); diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 9c5e190bf..161e4cca3 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -743,7 +743,7 @@ function media_upload_library() { */ function image_align_input_fields($post, $checked='') { - $alignments = array('none' => 'None', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right'); + $alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right')); if ( !array_key_exists($checked, $alignments) ) $checked = 'none'; @@ -752,7 +752,7 @@ function image_align_input_fields($post, $checked='') { $out[] = ""; + " />"; } return join("\n", $out); } diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index eddd4ea2d..a0b444644 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -787,11 +787,11 @@ function wp_edit_posts_query( $q = false ) { $q['m'] = isset($q['m']) ? (int) $q['m'] : 0; $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0; $post_stati = array( // array( adj, noun ) - 'publish' => array(__('Published'), __('Published posts'), _n_noop('Published (%s)', 'Published (%s)')), - 'future' => array(__('Scheduled'), __('Scheduled posts'), _n_noop('Scheduled (%s)', 'Scheduled (%s)')), - 'pending' => array(__('Pending Review'), __('Pending posts'), _n_noop('Pending Review (%s)', 'Pending Review (%s)')), - 'draft' => array(__('Draft'), _x('Drafts', 'manage posts header'), _n_noop('Draft (%s)', 'Drafts (%s)')), - 'private' => array(__('Private'), __('Private posts'), _n_noop('Private (%s)', 'Private (%s)')), + 'publish' => array(_x('Published', 'post'), __('Published posts'), _n_noop('Published (%s)', 'Published (%s)')), + 'future' => array(_x('Scheduled', 'post'), __('Scheduled posts'), _n_noop('Scheduled (%s)', 'Scheduled (%s)')), + 'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review (%s)', 'Pending Review (%s)')), + 'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft (%s)', 'Drafts (%s)')), + 'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private (%s)', 'Private (%s)')), ); $post_stati = apply_filters('post_stati', $post_stati); diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index b600c884c..22ca66baa 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -216,8 +216,11 @@ function populate_options() { 'default_post_edit_rows' => 10, 'posts_per_page' => 10, 'what_to_show' => 'posts', + /* translators: default date format, see http://php.net/date */ 'date_format' => __('F j, Y'), + /* translators: default time format, see http://php.net/date */ 'time_format' => __('g:i a'), + /* translators: links last updated date format, see http://php.net/date */ 'links_updated_date_format' => __('F j, Y g:i a'), 'links_recently_updated_prepend' => '', 'links_recently_updated_append' => '', diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index f360eb975..8509674ef 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1496,7 +1496,7 @@ function _post_row($a_post, $pending_comments, $mode) { $pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) ); if ( $pending_comments ) echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + comments_number("" . /* translators: comment count link */ _x('0', 'comment count') . '', "" . /* translators: comment count link */ _x('1', 'comment count') . '', "" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . ''); if ( $pending_comments ) echo ''; ?> @@ -1660,7 +1660,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) { $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + comments_number("" . /* translators: comment count link */ _x('0', 'comment count') . '', "" . /* translators: comment count link */ _x('1', 'comment count') . '', "" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . ''); if ( $left ) echo ''; ?> @@ -2183,7 +2183,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) ); if ( $pending_comments ) echo ''; - comments_number("" . __('0') . '', "" . __('1') . '', "" . __('%') . ''); + comments_number("" . /* translators: comment count link */ _x('0', 'comment count') . '', "" . /* translators: comment count link */ _x('1', 'comment count') . '', "" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . ''); if ( $pending_comments ) echo ''; echo ' '; diff --git a/wp-admin/install.php b/wp-admin/install.php index 48ec2dfb1..59678f0a6 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -51,7 +51,7 @@ header( 'Content-Type: text/html; charset=utf-8' ); function display_setup_form( $error = null ) { if ( ! is_null( $error ) ) { ?> -

    :

    +

    ERROR: %s'), $error); ?>

    diff --git a/wp-admin/load-scripts.php b/wp-admin/load-scripts.php index 69c49bbbc..ebb889426 100644 --- a/wp-admin/load-scripts.php +++ b/wp-admin/load-scripts.php @@ -14,6 +14,12 @@ function __() {} */ function _c() {} +/** + * @ignore + */ +function _x() {} + + /** * @ignore */ diff --git a/wp-admin/load-styles.php b/wp-admin/load-styles.php index 007d45d60..e827c9971 100644 --- a/wp-admin/load-styles.php +++ b/wp-admin/load-styles.php @@ -14,6 +14,12 @@ function __() {} */ function _c() {} +/** + * @ignore + */ +function _x() {} + + /** * @ignore */ diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 13210548f..f977781f8 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -984,8 +984,10 @@ function get_calendar($initial = true) { ORDER BY post_date ASC LIMIT 1"); + /* translators: Calendar caption: 1: month name, 2: 4-digit year */ + $calendar_caption = _x('%1$s %2$s', 'calendar caption'); echo '
    - + '; @@ -1412,7 +1414,8 @@ function automatic_feed_links( $add = true ) { */ function feed_links( $args ) { $defaults = array( - 'seperator' => _c('»|Seperator character for feed titles in theme head'), + /* translators: Separator between blog name and feed type in feed links */ + 'separator' => _x('»', 'feed link'), 'feedtitle' => __('%s Feed'), 'comstitle' => __('%s Comments Feed'), ); @@ -1432,11 +1435,17 @@ function feed_links( $args ) { */ function feed_links_extra( $args ) { $defaults = array( - 'seperator' => _c('»|Seperator character for feed titles in theme head'), + /* translators: Separator between blog name and feed type in feed links */ + 'separator' => _x('»', 'feed link'), + /* translators: 1: blog name, 2: separator(raquo), 3: post title */ 'singletitle' => __('%1$s %2$s %3$s Comments Feed'), + /* translators: 1: blog name, 2: separator(raquo), 3: category name */ 'cattitle' => __('%1$s %2$s %3$s Category Feed'), + /* translators: 1: blog name, 2: separator(raquo), 3: tag name */ 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), + /* translators: 1: blog name, 2: separator(raquo), 3: author name */ 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), + /* translators: 1: blog name, 2: separator(raquo), 3: search phrase */ 'searchtitle' => __('%1$s %2$s Search Results for "%3$s" Feed'), ); @@ -1446,27 +1455,27 @@ function feed_links_extra( $args ) { $post = &get_post( $id = 0 ); if ( comments_open() || pings_open() || $post->comment_count > 0 ) { - $title = attribute_escape(sprintf( $args['singletitle'], get_bloginfo('name'), $args['seperator'], wp_specialchars( get_the_title() ) )); + $title = attribute_escape(sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], wp_specialchars( get_the_title() ) )); $href = get_post_comments_feed_link( $post->ID ); } } elseif ( is_category() ) { $cat_id = intval( get_query_var('cat') ); - $title = attribute_escape(sprintf( $args['cattitle'], get_bloginfo('name'), $args['seperator'], get_cat_name( $cat_id ) )); + $title = attribute_escape(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) )); $href = get_category_feed_link( $cat_id ); } elseif ( is_tag() ) { $tag_id = intval( get_query_var('tag_id') ); $tag = get_tag( $tag_id ); - $title = attribute_escape(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['seperator'], $tag->name )); + $title = attribute_escape(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name )); $href = get_tag_feed_link( $tag_id ); } elseif ( is_author() ) { $author_id = intval( get_query_var('author') ); - $title = attribute_escape(sprintf( $args['authortitle'], get_bloginfo('name'), $args['seperator'], get_author_name( $author_id ) )); + $title = attribute_escape(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_author_name( $author_id ) )); $href = get_author_feed_link( $author_id ); } elseif ( is_search() ) { - $title = attribute_escape(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['seperator'], get_search_query() )); + $title = attribute_escape(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() )); $href = get_search_feed_link(); } diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php index 8e9ae2cd3..1e4c9923c 100644 --- a/wp-includes/js/tinymce/langs/wp-langs.php +++ b/wp-includes/js/tinymce/langs/wp-langs.php @@ -150,8 +150,8 @@ desc:"' . mce_escape( __('Toggle fullscreen mode') ) . ' (Alt+Shift+G)" }, media:{ desc:"' . mce_escape( __('Insert / edit embedded media') ) . '", -delta_width:"' . mce_escape( _c('0| Extra width for the media popup in pixels') ) . '", -delta_height:"' . mce_escape( _c('0| Extra height for the media popup in pixels') ) . '", +delta_width:"' . /* translators: Extra width for the media popup in pixels */ mce_escape( _x('0', 'media popup width') ) . '", +delta_height:"' . /* translators: Extra height for the media popup in pixels */ mce_escape( _x('0', 'media popup height') ) . '", edit:"' . mce_escape( __('Edit embedded media') ) . '" }, fullpage:{ @@ -213,12 +213,12 @@ indent_desc:"' . mce_escape( __('Indent') ) . '", undo_desc:"' . mce_escape( __('Undo') ) . ' (Ctrl+Z)", redo_desc:"' . mce_escape( __('Redo') ) . ' (Ctrl+Y)", link_desc:"' . mce_escape( __('Insert/edit link') ) . ' (Alt+Shift+A)", -link_delta_width:"' . mce_escape( _c('0| Extra width for the link popup in pixels') ) . '", -link_delta_height:"' . mce_escape( _c('0| Extra height for the link popup in pixels') ) . '", +link_delta_width:"' . /* translators: Extra width for the link popup in pixels */ mce_escape( _x('0', 'link popup width') ) . '", +link_delta_height:"' . /* translators: Extra height for the link popup in pixels */ mce_escape( _x('0', 'link popup height') ) . '", unlink_desc:"' . mce_escape( __('Unlink') ) . ' (Alt+Shift+S)", image_desc:"' . mce_escape( __('Insert/edit image') ) . ' (Alt+Shift+M)", -image_delta_width:"' . mce_escape( _c('0| Extra width for the image popup in pixels') ) . '", -image_delta_height:"' . mce_escape( _c('0| Extra height for the image popup in pixels') ) . '", +image_delta_width:"' . /* translators: Extra width for the image popup in pixels */ mce_escape( _x('0', 'image popup width') ) . '", +image_delta_height:"' . /* translators: Extra height for the image popup in pixels */ mce_escape( _x('0', 'image popup height') ) . '", cleanup_desc:"' . mce_escape( __('Cleanup messy code') ) . '", code_desc:"' . mce_escape( __('Edit HTML Source') ) . '", sub_desc:"' . mce_escape( __('Subscript') ) . '", @@ -242,8 +242,8 @@ path:"' . mce_escape( __('Path') ) . '", newdocument:"' . mce_escape( __('Are you sure you want to clear all contents?') ) . '", toolbar_focus:"' . mce_escape( __('Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X') ) . '", more_colors:"' . mce_escape( __('More colors') ) . '", -colorpicker_delta_width:"' . mce_escape( _c('0| Extra width for the colorpicker popup in pixels') ) . '", -colorpicker_delta_height:"' . mce_escape( _c('0| Extra height for the colorpicker popup in pixels') ) . '" +colorpicker_delta_width:"' . /* translators: Extra width for the colorpicker popup in pixels */ mce_escape( _x('0', 'colorpicker popup width') ) . '", +colorpicker_delta_height:"' . /* translators: Extra height for the colorpicker popup in pixels */ mce_escape( _x('0', 'colorpicker popup height') ) . '" }); tinyMCE.addI18n("' . $language . '.advanced_dlg",{ diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index e1b00b78c..da86f42a3 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -222,14 +222,22 @@ function __ngettext_noop() { * @since 2.5 * @param $single Single form to be i18ned * @param $plural Plural form to be i18ned - * @param $number Not used, here for compatibility with _n, optional - * @param $domain Not used, here for compatibility with _n, optional * @return array array($single, $plural) */ -function _n_noop( $single, $plural, $number = 1, $domain = 'default' ) { +function _n_noop( $single, $plural ) { return array( $single, $plural ); } +/** + * Register plural strings with context in POT file, but don't translate them. + * + * @see _n_noop() + */ +function _nx_noop( $single, $plural, $context ) { + return array( $single, $plural, $context ); +} + + /** * Loads MO file into the list of domains. * diff --git a/wp-includes/locale.php b/wp-includes/locale.php index 135c6bf72..7f5392c1b 100644 --- a/wp-includes/locale.php +++ b/wp-includes/locale.php @@ -178,13 +178,16 @@ class WP_Locale { // Numbers formatting // See http://php.net/number_format - $trans = _c('number_format_decimals|$decimals argument for http://php.net/number_format, default is 0'); + /* translators: $decimals argument for http://php.net/number_format, default is 0 */ + $trans = __('number_format_decimals'); $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans; - $trans = _c('number_format_decimal_point|$dec_point argument for http://php.net/number_format, default is .'); + /* translators: $dec_point argument for http://php.net/number_format, default is . */ + $trans = __('number_format_decimal_point'); $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; - $trans = _c('number_format_thousands_sep|$thousands_sep argument for http://php.net/number_format, default is ,'); + /* translators: $thousands_sep argument for http://php.net/number_format, default is , */ + $trans = __('number_format_thousands_sep'); $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; // Import global locale vars set during inclusion of $locale.php. diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index b3ef040c2..8d12284cb 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1193,9 +1193,12 @@ function wp_post_revision_title( $revision, $link = true ) { if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) ) return false; - $datef = _c( 'j F, Y @ G:i|revision date format'); - $autosavef = __( '%s [Autosave]' ); - $currentf = __( '%s [Current Revision]' ); + /* translators: revision date format, see http://php.net/date */ + $datef = _x( 'j F, Y @ G:i', 'revision date format'); + /* translators: 1: date */ + $autosavef = __( '%1$s [Autosave]' ); + /* translators: 1: date */ + $currentf = __( '%1$s [Current Revision]' ); $date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) ); if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) @@ -1260,7 +1263,8 @@ function wp_list_post_revisions( $post_id = 0, $args = null ) { break; } - $titlef = _c( '%1$s by %2$s|post revision 1:datetime, 2:name' ); + /* translators: post revision: 1: when, 2: author name */ + $titlef = _x( '%1$s by %2$s', 'post revision' ); if ( $parent ) array_unshift( $revisions, $post ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 28cea1eff..0b4796c21 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -231,7 +231,8 @@ function wp_default_scripts( &$scripts ) { 'empty' => __('Strength indicator'), 'short' => __('Very weak'), 'bad' => __('Weak'), - 'good' => _c('Medium|password strength'), + /* translators: password strength */ + 'good' => _x('Medium', 'password strength'), 'strong' => __('Strong'), 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};' ) ); diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 1229cf2c4..426a487ba 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1446,7 +1446,7 @@ function wp_widget_recent_comments($args) {
    ' . sprintf(_c('%1$s %2$s|Used as a calendar caption'), $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '