WordPress.org

Make WordPress Core

Ticket #9112: i18n-gettext-contexts-0.diff

File i18n-gettext-contexts-0.diff, 18.9 KB (added by nbachiyski, 13 years ago)

First patch using _x and extracted coments

  • wp-admin/includes/dashboard.php

     
    526526                $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
    527527                //$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick&nbsp;Edit') . '</a>';
    528528                $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    529                 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . _c( 'Spam|verb' ) . '</a>';
     529                $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */  _x( 'Spam', 'verb' ) . '</a>';
    530530                $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    531531
    532532                $actions = apply_filters( 'comment_row_actions', $actions, $comment );
     
    566566                                endswitch;
    567567                                $type = wp_specialchars( $type );
    568568                        ?>
    569 
    570                         <h4 class="comment-meta"><?php printf( __( '%1$s on %2$s' ), "<strong>$type</strong>", $comment_post_link ); ?></h4>
     569                        <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
     570                        <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></h4>
    571571                        <p class="comment-author"><?php comment_author_link(); ?></p>
    572572
    573573                        <?php endif; // comment_type ?>
     
    630630                $content = wp_html_excerpt($content, 50) . ' ...';
    631631
    632632                if ( $link )
    633                         $text = _c( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"|feed_display' );
     633                        /* translators: incoming links feed, %1$s is other person, %3$s is content */
     634                        $text = __( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"' );
    634635                else
    635                         $text = _c( '%1$s linked here saying, "%3$s"|feed_display' );
     636                        /* translators: incoming links feed, %1$s is other person, %3$s is content */
     637                        $text = __( '%1$s linked here saying, "%3$s"' );
    636638
    637639                if ( $show_date ) {
    638640                        if ( $show_author || $show_summary )
    639                                 $text .= _c( ' on %4$s|feed_display' );
     641                                /* translators: incoming links feed, %4$s is the date */
     642                                $text .= ' ' . __( 'on %4$s' );
    640643                        $date = wp_specialchars( strip_tags( $item->get_date() ) );
    641644                        $date = strtotime( $date );
    642645                        $date = gmdate( get_option( 'date_format' ), $date );
    643646                }
    644647
    645                 echo "\t<li>" . sprintf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ) . "</li>\n";
     648                echo "\t<li>" . sprintf( $text, $publisher, $link, $content, $date ) . "</li>\n";
    646649        }
    647650
    648651        echo "</ul>\n";
  • wp-admin/includes/widgets.php

     
    263263        unset($wp_registered_widgets[$widget_id]['_callback']);
    264264
    265265        if ( $widget_title && $widget_title != $sidebar_args['widget_name'] )
    266                 $widget_title = sprintf( _c('%1$s: %2$s|1: widget name, 2: widget title' ), $sidebar_args['widget_name'], $widget_title );
     266                /* translators: 1: widget name, 2: widget title */
     267                $widget_title = sprintf( _x('%1$s: %2$s', 'widget' ), $sidebar_args['widget_name'], $widget_title );
    267268        else
    268269                $widget_title = wp_specialchars( strip_tags( $sidebar_args['widget_name'] ) );
    269270
  • wp-admin/includes/template.php

     
    735735function wp_manage_posts_columns() {
    736736        $posts_columns = array();
    737737        $posts_columns['cb'] = '<input type="checkbox" />';
    738         $posts_columns['title'] = _c('Post|noun');
     738        /* translators: manage posts column name */
     739        $posts_columns['title'] = _x('Post', 'column name');
    739740        $posts_columns['author'] = __('Author');
    740741        $posts_columns['categories'] = __('Categories');
    741742        $posts_columns['tags'] = __('Tags');
     
    759760        $posts_columns = array();
    760761        $posts_columns['cb'] = '<input type="checkbox" />';
    761762        $posts_columns['icon'] = '';
    762         $posts_columns['media'] = _c('File|media column header');
     763        /* translators: column name */
     764        $posts_columns['media'] = _x('File', 'column name');
    763765        $posts_columns['author'] = __('Author');
    764766        //$posts_columns['tags'] = _c('Tags|media column header');
    765         $posts_columns['parent'] = _c('Attached to|media column header');
     767        /* translators: column name */
     768        $posts_columns['parent'] = _x('Attached to', 'column name');
    766769        $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
    767770        //$posts_columns['comments'] = __('Comments');
    768         $posts_columns['date'] = _c('Date|media column header');
     771        /* translators: column name */
     772        $posts_columns['date'] = _x('Date', 'column name');
    769773        $posts_columns = apply_filters('manage_media_columns', $posts_columns);
    770774
    771775        return $posts_columns;
     
    823827                        $_wp_column_headers[$page] = array(
    824828                                'cb' => '<input type="checkbox" />',
    825829                                'author' => __('Author'),
    826                                 'comment' => _c('Comment|noun'),
     830                                /* translators: column name */
     831                                'comment' => _x('Comment', 'column name'),
    827832                                //'date' => __('Submitted'),
    828833                                'response' => __('In Response To')
    829834                        );
     
    10601065                                <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
    10611066                        </label>
    10621067
    1063                         <em style="margin:5px 10px 0 0" class="alignleft"><?php echo _c( '&ndash;OR&ndash;|Between password field and private checkbox on post quick edit interface' ); ?></em>
    1064 
     1068                        <em style="margin:5px 10px 0 0" class="alignleft">
     1069                                <?php
     1070                                /* translators: Between password field and private checkbox on post quick edit interface */
     1071                                echo __( '&ndash;OR&ndash;' );
     1072                                ?>
     1073                        </em>
    10651074                        <label class="alignleft inline-edit-private">
    10661075                                <input type="checkbox" name="keep_private" value="private" />
    10671076                                <span class="checkbox-title"><?php echo $is_page ? __('Private page') : __('Private post'); ?></span>
     
    21042113                                                }
    21052114                                        }
    21062115                                        if ( 'spam' != $the_comment_status )
    2107                                                 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . _c( 'Spam|verb' ) . '</a>';
     2116                                                $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
    21082117                                        $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    21092118                                        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
    21102119                                        $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick&nbsp;Edit') . '</a>';
     
    25092518        $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off" />';
    25102519        $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    25112520        $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    2512         printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);
     2521        /* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */
     2522        printf(__('%1$s%2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
    25132523
    25142524        echo '<input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    25152525
     
    32783288        if ( 'draft' == $post->post_status && 'draft' != $post_status )
    32793289                $post_states[] = __('Draft');
    32803290        if ( 'pending' == $post->post_status && 'pending' != $post_status )
    3281                 $post_states[] = _c('Pending|post state');
     3291                /* translators: post state */
     3292                $post_states[] = _x('Pending', 'post state');
    32823293        if ( is_sticky($post->ID) )
    32833294                $post_states[] = __('Sticky');
    32843295
  • wp-admin/edit-page-form.php

     
    181181</div><?php // /misc-pub-section ?>
    182182
    183183<?php
    184 $datef = _c( 'M j, Y @ G:i|Publish box date format');
     184// translators: Publish box date formt, see http://php.net/date
     185$datef = __( 'M j, Y @ G:i' );
    185186if ( 0 != $post->ID ) {
    186187        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    187188                $stamp = __('Scheduled for: <b>%1$s</b>');
  • wp-admin/comment.php

     
    123123</tr>
    124124<?php } ?>
    125125<tr>
    126 <th scope="row" valign="top"><?php echo _c('Comment|noun'); ?></th>
     126<th scope="row" valign="top"><?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
    127127<td><?php echo $comment->comment_content; ?></td>
    128128</tr>
    129129</table>
  • wp-admin/gears-manifest.php

     
    2323/**
    2424 * @ignore
    2525 */
     26function _x() {}
     27
     28
     29/**
     30 * @ignore
     31 */
    2632function add_filter() {}
    2733
    2834/**
  • wp-admin/upload.php

     
    302302<tr>
    303303        <th scope="col" class="check-column"><input type="checkbox" /></th>
    304304        <th scope="col"></th>
    305         <th scope="col"><?php echo _c('Media|media column header'); ?></th>
    306         <th scope="col"><?php echo _c('Date Added|media column header'); ?></th>
     305        <th scope="col"><?php /* translators: column name in media */ echo _x('Media', 'media column name'); ?></th>
     306        <th scope="col"><?php /* translators: column name in media */ echo _x('Date Added', 'media column name'); ?></th>
    307307</tr>
    308308</thead>
    309309
     
    311311<tr>
    312312        <th scope="col" class="check-column"><input type="checkbox" /></th>
    313313        <th scope="col"></th>
    314         <th scope="col"><?php echo _c('Media|media column header'); ?></th>
    315         <th scope="col"><?php echo _c('Date Added|media column header'); ?></th>
     314        <th scope="col"><?php /* translators: column name in media */ echo _x('Media', 'media column name'); ?></th>
     315        <th scope="col"><?php /* translators: column name in media */ echo _x('Date Added', 'media column name'); ?></th>
    316316</tr>
    317317</tfoot>
    318318
  • wp-admin/edit-form-comment.php

     
    4848<div id="misc-publishing-actions">
    4949
    5050<div class="misc-pub-section" id="comment-status-radio">
    51 <label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php echo _c('Approved|adjective') ?></label><br />
    52 <label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php echo _c('Pending|adjective') ?></label><br />
    53 <label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php echo _c('Spam|adjective'); ?></label>
     51<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php /* translators: comment type radio button */ echo _x('Approved', 'adjective') ?></label><br />
     52<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php /* translators: comment type radio button */ echo _x('Pending', 'adjective') ?></label><br />
     53<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php /* translators: comment type radio button */ echo _x('Spam', 'adjective'); ?></label>
    5454</div>
    5555
    5656<div class="misc-pub-section curtime misc-pub-section-last">
    5757<?php
    58 $datef = _c( 'M j, Y @ G:i|Publish box date format');
     58// translators: Publish box date formt, see http://php.net/date
     59$datef = __( 'M j, Y @ G:i' );
    5960$stamp = __('Submitted on: <b>%1$s</b>');
    6061$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
    6162?>
  • wp-admin/edit-form-advanced.php

     
    191191
    192192
    193193<?php
    194 $datef = _c( 'M j, Y @ G:i|Publish box date format');
     194// translators: Publish box date formt, see http://php.net/date
     195$datef = __( 'M j, Y @ G:i' );
    195196if ( 0 != $post->ID ) {
    196197        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    197198                $stamp = __('Scheduled for: <b>%1$s</b>');
     
    468469<thead>
    469470        <tr>
    470471    <th scope="col" class="column-author"><?php _e('Author') ?></th>
    471     <th scope="col" class="column-comment"><?php echo _c('Comment|noun') ?></th>
     472    <th scope="col" class="column-comment">
     473                <?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?>
     474        </th>
    472475  </tr>
    473476</thead>
    474477<tbody id="the-comment-list" class="list:comment">
  • wp-admin/menu.php

     
    3131
    3232$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'wp-menu-open menu-top', 'menu-posts', 'div' );
    3333        $submenu['edit.php'][5]  = array( __('Edit'), 'edit_posts', 'edit.php' );
    34         $submenu['edit.php'][10]  = array( _c('Add New|post'), 'edit_posts', 'post-new.php' );
     34        /* translators: add new post */
     35        $submenu['edit.php'][10]  = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' );
    3536
    3637        $i = 15;
    3738        foreach ( $wp_taxonomies as $tax ) {
     
    4647
    4748$menu[10] = array( __('Media'), 'upload_files', 'upload.php', '', 'menu-top', 'menu-media', 'div' );
    4849        $submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php');
    49         $submenu['upload.php'][10] = array( _c('Add New|file'), 'upload_files', 'media-new.php');
     50        /* translators: add new file */
     51        $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php');
    5052
    5153$menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top', 'menu-links', 'div' );
    5254        $submenu['link-manager.php'][5] = array( __('Edit'), 'manage_links', 'link-manager.php' );
    53         $submenu['link-manager.php'][10] = array( _c('Add New|links'), 'manage_links', 'link-add.php' );
     55        /* translators: add new links */
     56        $submenu['link-manager.php'][10] = array( _x('Add New', 'links'), 'manage_links', 'link-add.php' );
    5457        $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-link-categories.php' );
    5558
    5659$menu[20] = array( __('Pages'), 'edit_pages', 'edit-pages.php', '', 'menu-top', 'menu-pages', 'div' );
    5760        $submenu['edit-pages.php'][5] = array( __('Edit'), 'edit_pages', 'edit-pages.php' );
    58         $submenu['edit-pages.php'][10] = array( _c('Add New|page'), 'edit_pages', 'page-new.php' );
     61        /* translators: add new page */
     62        $submenu['edit-pages.php'][10] = array( _x('Add New', 'page'), 'edit_pages', 'page-new.php' );
    5963
    6064$menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' );
    6165
     
    7579
    7680$menu[65] = array( sprintf( __('Plugins %s'), "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' );
    7781        $submenu['plugins.php'][5]  = array( __('Installed'), 'activate_plugins', 'plugins.php' );
    78         $submenu['plugins.php'][10] = array(_c('Add New|plugin'), 'install_plugins', 'plugin-install.php');
     82        /* translators: add new plugin */
     83        $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
    7984        $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' );
    8085
    8186if ( current_user_can('edit_users') )
  • wp-admin/edit-pages.php

     
    290290<table class="widefat" cellspacing="0">
    291291<thead>
    292292  <tr>
    293     <th scope="col" class="column-comment"><?php echo _c('Comment|noun') ?></th>
     293    <th scope="col" class="column-comment">
     294                <?php  /* translators: column name */ echo _x('Comment', 'column name') ?>
     295        </th>
    294296    <th scope="col" class="column-author"><?php _e('Author') ?></th>
    295297    <th scope="col" class="column-date"><?php _e('Submitted') ?></th>
    296298  </tr>
  • wp-admin/themes.php

     
    108108<?php if ( $ct->screenshot ) : ?>
    109109<img src="<?php echo WP_CONTENT_URL . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
    110110<?php endif; ?>
    111 <h4><?php printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author) ; ?></h4>
     111<h4><?php
     112        /* translators: 1: theme title, 2: theme version, 3: theme author */
     113        printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h4>
    112114<p class="description"><?php echo $ct->description; ?></p>
    113115<?php if ($ct->parent_theme) { ?>
    114116        <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p>