Make WordPress Core

Changeset 4658


Ignore:
Timestamp:
12/21/2006 11:06:18 PM (20 years ago)
Author:
markjaquith
Message:

i18n fixes, logic cleanup, wording clarifications, and more from nbachiyski. fixes #3474

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r4657 r4658  
    4141                if ( 'page' == $_POST['post_type'] ) {
    4242                        if ( !current_user_can( 'edit_others_pages' ) )
    43                                 return new WP_Error( 'edit_others_pages', __( 'You cannot create pages as this user.' ) );
     43                                return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
    4444                } else {
    4545                        if ( !current_user_can( 'edit_others_posts' ) )
    46                                 return new WP_Error( 'edit_others_posts', __( 'You cannot post as this user.' ) );
     46                                return new WP_Error( 'edit_others_posts', __( 'You are not allowed to post as this user.' ) );
    4747
    4848                }
    … …  
    185185                if ( 'page' == $_POST['post_type'] ) {
    186186                        if ( !current_user_can( 'edit_others_pages' ) )
    187                                 wp_die( __('You cannot edit pages as this user.' ));
     187                                wp_die( __('You are not allowed to edit pages as this user.' ));
    188188                } else {
    189189                        if ( !current_user_can( 'edit_others_posts' ) )
    190                                 wp_die( __('You cannot edit posts as this user.' ));
     190                                wp_die( __('You are not allowed to edit posts as this user.' ));
    191191
    192192                }
    … …  
    562562function edit_link( $link_id = '' ) {
    563563        if (!current_user_can( 'manage_links' ))
    564                 wp_die( __("Cheatin' uh ?" ));
     564                wp_die( __( 'Cheatin&8217; uh?' ));
    565565
    566566        $_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
    … …  
    827827        if ( $numposts > 0 ) {
    828828                $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
    829                 $r .= sprintf( __('View %1$s %2$s' ), $numposts, __ngettext( 'post', 'posts', $numposts ));
     829                $r .= sprintf(__ngettext( 'View %s post', 'View %s posts', $numposts ), $numposts);
    830830                $r .= '</a>';
    831831        }
    … …  
    10701070<?php
    10711071        if ( $edit ) {
    1072                 _e( 'Existing timestamp' );
    1073                 //echo ': ' . $wp_locale->get_month( $mm ) . "$jj, $aa @ $hh:$mn";
    1074                 echo sprintf( __(': %1$s %2$s, %3$s @ %4$s:%5$s' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );
     1072                printf( __('Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );
    10751073        }
    10761074?>
  • trunk/wp-admin/categories.php

    r4499 r4658  
    3535        // Don't delete the default cats.
    3636    if ( $cat_ID == get_option('default_category') )
    37                 wp_die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one"), $cat_name));
     37                wp_die(sprintf(__("Can&8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
    3838
    3939    if ( $cat_ID == get_option('default_link_category') )
    40                 wp_die(sprintf(__("Can't delete the <strong>%s</strong> category: this is the default one for links"), $cat_name));
     40                wp_die(sprintf(__("Can&8217;t delete the <strong>%s</strong> category: this is the default one for links"), $cat_name));
    4141
    4242        wp_delete_category($cat_ID);
  • trunk/wp-admin/edit-comments.php

    r4656 r4658  
    6868        endforeach;
    6969        echo '<div style="background-color: rgb(207, 235, 247);" id="message" class="updated fade"><p>';
    70         if ( !empty( $_POST['spam_button'] ) )
    71                 printf(__('%s comments marked as spam.'), $i);
    72         else
    73                 printf(__('%s comments deleted.'), $i);
     70        if ( !empty( $_POST['spam_button'] ) ) {
     71                printf(__ngettext('%s comment marked as spam', '%s comments marked as spam.', $i), $i);
     72        } else {
     73                printf(__ngettext('%s comment deleted.', '%s comments deleted.', $i), $i);
     74        }
    7475        echo '</p></div>';
    7576endif;
  • trunk/wp-admin/edit-form-advanced.php

    r4656 r4658  
    207207</div>
    208208<div class="dbx-c-ontent-wrapper">
    209 <div class="dbx-content"><?php _e('Send trackbacks to'); ?>: <?php echo $form_trackback; ?> (<?php _e('Separate multiple URIs with spaces'); ?>)
     209<div class="dbx-content"><?php _e('Send trackbacks to:'); ?> <?php echo $form_trackback; ?> (<?php _e('Separate multiple URLs with spaces'); ?>)
    210210<?php
    211211if ( ! empty($pings) )
  • trunk/wp-admin/edit-form-comment.php

    r4607 r4658  
    6868        <tr>
    6969                <th scope="row" valign="top"><?php _e('Delete'); $delete_nonce = wp_create_nonce( 'delete-comment_' . $comment->comment_ID ); ?>:</th>
    70                 <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . __("You are about to delete this comment \\n  \'Cancel\' to stop, \'OK\' to delete.") . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true; } return false;\""; ?> />
     70                <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true; } return false;\""; ?> />
    7171                <input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" />
    7272                <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" />
  • trunk/wp-admin/edit-form.php

    r4495 r4658  
    5252<input type="hidden" name="post_pingback" value="<?php echo get_option('default_pingback_flag') ?>" id="post_pingback" />
    5353
    54 <p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?>
     54<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '<br />'; ?>
    5555        <input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>
    5656
  • trunk/wp-admin/edit-page-form.php

    r4656 r4658  
    5353<label for="comment_status" class="selectit">
    5454<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
    55 <?php _e('Allow Comments') ?></label> 
     55<?php _e('Allow Comments') ?></label>
    5656<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
    5757</div>
    … …  
    5959
    6060<fieldset class="dbx-box">
    61 <h3 class="dbx-handle"><?php _e('Page Status') ?></h3> 
     61<h3 class="dbx-handle"><?php _e('Page Status') ?></h3>
    6262<div class="dbx-content"><?php if ( current_user_can('publish_pages') ) : ?>
    6363<label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); checked($post->post_status, 'future'); ?> /> <?php _e('Published') ?></label>
    … …  
    6868
    6969<fieldset id="passworddiv" class="dbx-box">
    70 <h3 class="dbx-handle"><?php _e('Page Password') ?></h3> 
     70<h3 class="dbx-handle"><?php _e('Page Password') ?></h3>
    7171<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
    7272</fieldset>
    7373
    7474<fieldset id="pageparent" class="dbx-box">
    75 <h3 class="dbx-handle"><?php _e('Page Parent') ?></h3> 
     75<h3 class="dbx-handle"><?php _e('Page Parent') ?></h3>
    7676<div class="dbx-content"><p><select name="parent_id">
    7777<option value='0'><?php _e('Main Page (no parent)'); ?></option>
    … …  
    8383<?php if ( 0 != count( get_page_templates() ) ) { ?>
    8484<fieldset id="pagetemplate" class="dbx-box">
    85 <h3 class="dbx-handle"><?php _e('Page Template:') ?></h3>
     85<h3 class="dbx-handle"><?php _e('Page Template') ?></h3>
    8686<div class="dbx-content"><p><select name="page_template">
    8787                <option value='default'><?php _e('Default Template'); ?></option>
    … …  
    9393
    9494<fieldset id="slugdiv" class="dbx-box">
    95 <h3 class="dbx-handle"><?php _e('Page Slug') ?></h3> 
     95<h3 class="dbx-handle"><?php _e('Page Slug') ?></h3>
    9696<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
    9797</fieldset>
    … …  
    126126
    127127<fieldset id="titlediv">
    128   <legend><?php _e('Page Title') ?></legend> 
     128  <legend><?php _e('Page Title') ?></legend>
    129129  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
    130130</fieldset>
    … …  
    139139<span id="autosave"></span>
    140140<input name="save" type="submit" id="save" tabindex="3" value="<?php _e('Save and Continue Editing'); ?>" />
    141 <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" /> 
    142 <?php 
     141<input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="4" />
     142<?php
    143143if ('publish' != $post->post_status || 0 == $post_ID):
    144144?>
    145145<?php if ( current_user_can('publish_pages') ) : ?>
    146         <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 
     146        <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
    147147<?php endif; endif;?>
    148148<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
  • trunk/wp-admin/edit.php

    r4656 r4658  
    222222        case 'control_delete':
    223223                ?>
    224                 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape(get_the_title()) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>
     224                <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . js_escape(sprintf(__("You are about to delete this post '%s'.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . "</a>"; } ?></td>
    225225                <?php
    226226                break;
    … …  
    284284if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    285285        echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>';
    286         echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
     286        echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
    287287        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
    288288                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
    289289                echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
    290290        }
    291         echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=".$comment->comment_post_ID."&amp;c=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]";
     291        echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&amp;dt=spam&amp;p=".$comment->comment_post_ID."&amp;c=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), js_escape( $comment->comment_author))  . "', theCommentList );\">" . __('Spam') . "</a> ]";
    292292} // end if any comments to show
    293293?>
  • trunk/wp-admin/export.php

    r4608 r4658  
    1515<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
    1616<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p>
    17 <p><?php _e('Once you\'ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
     17<p><?php _e('Once you&8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
    1818<form action="" method="get">
    1919<h3><?php _e('Optional options'); ?></h3>
  • trunk/wp-admin/index.php

    r4495 r4658  
    108108if (0 < $numcats) $numcats = number_format($numcats);
    109109?>
    110 <p><?php printf(__('There are currently %1$s <a href="%2$s" title="Posts">posts</a> and %3$s <a href="%4$s" title="Comments">comments</a>, contained within %5$s <a href="%6$s" title="categories">categories</a>.'), $numposts, 'edit.php',  $numcomms, 'edit-comments.php', $numcats, 'categories.php'); ?></p>
     110<p><?php
     111$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), $numposts, 'edit.php');
     112$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), $numcomms, 'edit-comments.php');
     113$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), $numcats, 'categories.php');
     114
     115printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?></p>
    111116</div>
    112117
  • trunk/wp-admin/link-add.php

    r4539 r4658  
    2929<div id="wp-link-bookmarklet"  class="wrap">
    3030<h3><?php _e('Add Link Bookmarklet'); ?></h3>
    31 <p><?php _e('Right click on the following link and choose "Bookmark This Link..." to create an add link shortcut. Right now this only works on Mozilla or Netscape, but we’re working on it.'); ?></p>
     31<p><?php _e('Right click on the following link and choose "Bookmark This Link..." to create an add link shortcut. Right now this only works on Mozilla or Netscape, but we&8217;re working on it.'); ?></p>
    3232<?php printf('<p><a href="%s" title="'.__('Link add bookmarklet').'">'.__('Link This').'</a></p>', "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?>
    3333</div>
  • trunk/wp-admin/link-manager.php

    r4656 r4658  
    6666        echo '<div style="background-color: rgb(207, 235, 247);" id="message" class="updated fade"><p>';
    6767        $deleted = (int) $_GET['deleted'];
    68         printf(__('%s links deleted.'), $deleted);
     68        printf(__ngettext('%s link deleted.', '%s links deleted', $deleted), $deleted);
    6969        echo '</p></div>';
    7070}
  • trunk/wp-admin/moderation.php

    r4655 r4658  
    7373        $spam     = (int) $_GET['spam'];
    7474        if ($approved) {
    75                 if ('1' == $approved) {
    76                         echo __("1 comment approved") . " <br/>\n";
    77                 } else {
    78                  echo sprintf(__("%s comments approved <br />"), $approved) . "\n";
    79                 }
     75                printf(__ngettext('%s comment approved', '%s comments approved', $approved), $approved);
     76                echo "<br/>\n";
    8077        }
    8178        if ($deleted) {
    82                 if ('1' == $deleted) {
    83                         echo __("1 comment deleted") . " <br/>\n";
    84                 } else {
    85                         echo sprintf(__("%s comments deleted"), $deleted) . " <br/>\n";
    86                 }
     79                printf(__ngettext('%s comment deleted', '%s comments deleted', $deleted), $deleted);
     80                echo "<br/>\n";
    8781        }
    8882        if ($spam) {
    89                 if ('1' == $spam) {
    90                         echo __("1 comment marked as spam") . " <br/>\n";
    91                 } else {
    92                         echo sprintf(__("%s comments marked as spam"), $spam) . " <br/>\n";
    93                 }
     83                printf(__ngettext('%s comment marked as spam', '%s comments marked as spam', $spam), $spam);
     84                echo "<br/>\n";
    9485        }
    9586        if ($ignored) {
    96                 if ('1' == $ignored) {
    97                         echo __("1 comment unchanged") . " <br/>\n";
    98                 } else {
    99                         echo sprintf(__("%s comments unchanged"), $ignored) . " <br/>\n";
    100                 }
     87                printf(__ngettext('%s comment unchanged', '%s comments unchanged', $ignored), $ignored);
     88                echo "<br/>\n";
    10189        }
    10290        echo "</p></div>\n";
  • trunk/wp-admin/options-discussion.php

    r4480 r4658  
    1414<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" /></p>
    1515<fieldset class="options">
    16 <legend><?php _e('Usual settings for an article:<br /><small><em>(These settings may be overridden for individual articles.)</em></small>') ?></legend>
     16<legend><?php echo __('Usual settings for an article:').'<br /><small><em>('.__('These settings may be overridden for individual articles.').')</em></small>'; ?></legend>
    1717<ul>
    1818<li>
  • trunk/wp-admin/plugins.php

    r4646 r4658  
    8080if (empty($plugins)) {
    8181        echo '<p>';
    82         _e("Couldn't open plugins directory or there are no plugins available."); // TODO: make more helpful
     82        _e("Couldn&8217;t open plugins directory or there are no plugins available."); // TODO: make more helpful
    8383        echo '</p>';
    8484} else {
  • trunk/wp-admin/users.php

    r4656 r4658  
    291291                ?>
    292292                        <?php $delete_count = (int) $_GET['delete_count']; ?>
    293                         <div id="message" class="updated fade"><p><?php printf(__('%1$s %2$s deleted.'), $delete_count, __ngettext('user', 'users', $delete_count) ); ?></p></div>
     293                        <div id="message" class="updated fade"><p><?php printf(__ngettext('%s user deleted', '%s users deleted', $delete_count), $delete_count); ?></p></div>
    294294                <?php
    295295                        break;
  • trunk/wp-includes/formatting.php

    r4657 r4658  
    739739        if ($diff <= 3600) {
    740740                $mins = round($diff / 60);
    741                 if ($mins <= 1)
    742                         $since = __('1 min');
    743                 else
    744                         $since = sprintf( __('%s mins'), $mins);
     741                if ($mins <= 1) {
     742                        $mins = 1;
     743                }
     744                $since = sprintf(__ngettext('%s min', '%s mins', $mins), $mins);
    745745        } else if (($diff <= 86400) && ($diff > 3600)) {
    746746                $hours = round($diff / 3600);
    747                 if ($hours <= 1)
    748                         $since = __('1 hour');
    749                 else
    750                         $since = sprintf( __('%s hours'), $hours );
     747                if ($hours <= 1) {
     748                        $hour = 1;
     749                }
     750                $since = sprintf(__ngettext('%s hour', '%s hours', $hours), $hours);
    751751        } elseif ($diff >= 86400) {
    752752                $days = round($diff / 86400);
    753                 if ($days <= 1)
    754                         $since = __('1 day');
    755                 else
    756                         $since = sprintf( __('%s days'), $days );
     753                if ($days <= 1) {
     754                        $days = 1;
     755                }
     756                $since = sprintf(__('%s day', '%s days', $days), $days);
    757757        }
    758758        return $since;
Note: See TracChangeset for help on using the changeset viewer.