Make WordPress Core

Ticket #3474: i18n.diff

File i18n.diff, 16.4 KB (added by nbachiyski, 17 years ago)
  • wp-login.php

     
    9191
    9292        if ( $_POST ) {
    9393                if ( empty( $_POST['user_login'] ) )
    94                         $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.');
     94                        $errors['user_login'] = __('<strong>ERROR</strong>:').' '.__('The username field is empty.');
    9595                if ( empty( $_POST['user_email'] ) )
    96                         $errors['user_email'] = __('<strong>ERROR</strong>: The e-mail field is empty.');
     96                        $errors['user_email'] = __('<strong>ERROR</strong>:').' '.__('The e-mail field is empty.');
    9797
    9898                do_action('lostpassword_post');
    9999               
     
    104104                        $user_email = $user_data->user_email;
    105105
    106106                        if (!$user_email || $user_email != $_POST['user_email']) {
    107                                 $errors['invalidcombo'] = __('<strong>ERROR</strong>: Invalid username / e-mail combination.');
     107                                $errors['invalidcombo'] = __('<strong>ERROR</strong>:').' '.__('Invalid username / e-mail combination.');
    108108                        } else {
    109109                                do_action('retreive_password', $user_login);  // Misspelled and deprecated
    110110                                do_action('retrieve_password', $user_login);
     
    216216
    217217                // Check the username
    218218                if ( $user_login == '' )
    219                         $errors['user_login'] = __('<strong>ERROR</strong>: Please enter a username.');
     219                        $errors['user_login'] = __('<strong>ERROR</strong>:').' '.__('Please enter a username.');
    220220                elseif ( !validate_username( $user_login ) ) {
    221                         $errors['user_login'] = __('<strong>ERROR</strong>: This username is invalid.  Please enter a valid username.');
     221                        $errors['user_login'] = __('<strong>ERROR</strong>:').' '.__('This username is invalid.  Please enter a valid username.');
    222222                        $user_login = '';
    223223                } elseif ( username_exists( $user_login ) )
    224                         $errors['user_login'] = __('<strong>ERROR</strong>: This username is already registered, please choose another one.');
     224                        $errors['user_login'] = __('<strong>ERROR</strong>:').' '.__('This username is already registered, please choose another one.');
    225225
    226226                // Check the e-mail address
    227227                if ($user_email == '') {
    228                         $errors['user_email'] = __('<strong>ERROR</strong>: Please type your e-mail address.');
     228                        $errors['user_email'] = __('<strong>ERROR</strong>:').' '.__('Please type your e-mail address.');
    229229                } elseif ( !is_email( $user_email ) ) {
    230                         $errors['user_email'] = __('<strong>ERROR</strong>: The email address isn&#8217;t correct.');
     230                        $errors['user_email'] = __('<strong>ERROR</strong>:').' '.__('The email address isn&#8217;t correct.');
    231231                        $user_email = '';
    232232                } elseif ( email_exists( $user_email ) )
    233                         $errors['user_email'] = __('<strong>ERROR</strong>: This email is already registered, please choose another one.');
     233                        $errors['user_email'] = __('<strong>ERROR</strong>:').' '.__('This email is already registered, please choose another one.');
    234234
    235235                do_action('register_post');
    236236
     
    241241
    242242                        $user_id = wp_create_user( $user_login, $user_pass, $user_email );
    243243                        if ( !$user_id )
    244                                 $errors['registerfail'] = sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email'));
     244                                $errors['registerfail'] = sprintf(__('<strong>ERROR</strong>:').' '.__('Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email'));
    245245                        else {
    246246                                wp_new_user_notification($user_id, $user_pass);
    247247
     
    327327        }
    328328       
    329329        if ( $_POST && empty( $user_login ) )
    330                 $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.');
     330                $errors['user_login'] = __('<strong>ERROR</strong>:').' '.__('The username field is empty.');
    331331        if ( $_POST && empty( $user_pass ) )
    332                 $errors['user_pass'] = __('<strong>ERROR</strong>: The password field is empty.');
     332                $errors['user_pass'] = __('<strong>ERROR</strong>:').' '.__('The password field is empty.');
    333333
    334334        // Some parts of this script use the main login form to display a message
    335335        if              ( TRUE == $_GET['loggedout'] )                  $errors['loggedout']            = __('Successfully logged you out.');
  • wp-includes/pluggable.php

     
    174174                return false;
    175175
    176176        if ( '' == $password ) {
    177                 $error = __('<strong>ERROR</strong>: The password field is empty.');
     177                $error = __('<strong>ERROR</strong>:').' '.__('The password field is empty.');
    178178                return false;
    179179        }
    180180
     
    182182        //$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
    183183
    184184        if (!$login) {
    185                 $error = __('<strong>ERROR</strong>: Invalid username.');
     185                $error = __('<strong>ERROR</strong>:').' '.__('Invalid username.');
    186186                return false;
    187187        } else {
    188188                // If the password is already_md5, it has been double hashed.
     
    190190                if ( ($already_md5 && md5($login->user_pass) == $password) || ($login->user_login == $username && $login->user_pass == md5($password)) ) {
    191191                        return true;
    192192                } else {
    193                         $error = __('<strong>ERROR</strong>: Incorrect password.');
     193                        $error = __('<strong>ERROR</strong>:').' '.__('Incorrect password.');
    194194                        $pwd = '';
    195195                        return false;
    196196                }
  • wp-includes/l10n.php

     
    3838}
    3939
    4040// Return the plural form.
    41 function __ngettext($single, $plural, $number, $domain = 'default') {
     41function __n($single, $plural, $number, $domain = 'default') {
    4242        global $l10n;
    4343
    4444        if (isset($l10n[$domain])) {
  • wp-admin/users.php

     
    290290                case 'del_many':
    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(__n('%s user deleted', '%s users deleted', $delete_count), $delete_count); ?></p></div>
    294294                <?php
    295295                        break;
    296296                case 'add':
  • wp-admin/admin-ajax.php

     
    2121        $r .= "</td><td><textarea name='meta[$mid][value]' tabindex='6' rows='2' cols='30'>$value</textarea></td><td align='center'>";
    2222        $r .= "<input name='updatemeta' type='button' class='updatemeta' tabindex='6' value='Update' onclick='return theList.ajaxUpdater(&#039;meta&#039;,&#039;meta-$mid&#039;);' /><br />";
    2323        $r .= "<input name='deletemeta[$mid]' type='submit' onclick=\"return deleteSomething( 'meta', $mid, '";
    24         $r .= sprintf(__("You are about to delete the &quot;%s&quot; custom field on this post.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), $key_js);
     24        $r .= js_escape(sprintf(__("You are about to delete the '%s' custom field on this post.\n'OK' to delete, 'Cancel' to stop."), $key_js));
    2525        $r .= "' );\" class='deletemeta' tabindex='6' value='Delete' /></td></tr>";
    2626        return $r;
    2727}
  • wp-admin/admin-functions.php

     
    4040        if ( $_POST['post_author'] != $_POST['user_ID'] ) {
    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                }
    4949        }
     
    184184        if ( $_POST['post_author'] != $_POST['user_ID'] ) {
    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 edit posts as this user.' ));
    191191
    192192                }
    193193        }
     
    467467
    468468        /* checking that username has been typed */
    469469        if ( $user->user_login == '' )
    470                 $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ));
     470                $errors->add( 'user_login', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'Please enter a username.' ));
    471471
    472472        /* checking the password has been typed twice */
    473473        do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));
    474474
    475475        if (!$update ) {
    476476                if ( $pass1 == '' || $pass2 == '' )
    477                         $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' ));
     477                        $errors->add( 'pass', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'Please enter your password twice.' ));
    478478        } else {
    479479                if ((empty ( $pass1 ) && !empty ( $pass2 ) ) || (empty ( $pass2 ) && !empty ( $pass1 ) ) )
    480                         $errors->add( 'pass', __( "<strong>ERROR</strong>: you typed your new password only once." ));
     480                        $errors->add( 'pass', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'You typed your new password only once.' ));
    481481        }
    482482
    483483        /* Check for "\" in password */
    484484        if( strpos( " ".$pass1, "\\" ) )
    485                 $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ));
     485                $errors->add( 'pass', __( '<strong>ERROR</strong>:' ) . ' '. __( 'Passwords may not contain the character "\\".' ));
    486486
    487487        /* checking the password has been typed twice the same */
    488488        if ( $pass1 != $pass2 )
    489                 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please type the same password in the two password fields.' ));
     489                $errors->add( 'pass', __( '<strong>ERROR</strong>:' ) . ' '. __( 'Please type the same password in the two password fields.' ));
    490490
    491491        if (!empty ( $pass1 ))
    492492                $user->user_pass = $pass1;
    493493
    494494        if ( !validate_username( $user->user_login ) )
    495                 $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid.  Please enter a valid username.' ));
     495                $errors->add( 'user_login', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'This username is invalid.  Please enter a valid username.' ));
    496496
    497497        if (!$update && username_exists( $user->user_login ))
    498                 $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered, please choose another one.' ));
     498                $errors->add( 'user_login', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'This username is already registered, please choose another one.' ));
    499499
    500500        /* checking e-mail address */
    501501        if ( empty ( $user->user_email ) ) {
    502                 $errors->add( 'user_email', __( "<strong>ERROR</strong>: please type an e-mail address" ));
     502                $errors->add( 'user_email', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'Please type an e-mail address' ));
    503503        } else
    504504                if (!is_email( $user->user_email ) ) {
    505                         $errors->add( 'user_email', __( "<strong>ERROR</strong>: the email address isn't correct" ));
     505                        $errors->add( 'user_email', __( '<strong>ERROR</strong>:' ) . ' ' . __( 'The email address isn&8217;t correct' ));
    506506                }
    507507
    508508        if ( $errors->get_error_codes() )
     
    555555
    556556function edit_link( $link_id = '' ) {
    557557        if (!current_user_can( 'manage_links' ))
    558                 wp_die( __("Cheatin' uh ?" ));
     558                wp_die( __( 'Cheatin&8217; uh?' ));
    559559
    560560        $_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
    561561        $_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];
     
    744744                $default_link_cat_id = get_option( 'default_link_category' );
    745745
    746746                if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) )
    747                         $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf( __("You are about to delete the category &quot;%s&quot;.\\nAll of its posts will go into the default category of &quot;%s&quot;\\nAll of its bookmarks will go into the default category of &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop." ), js_escape( $category->cat_name ), js_escape( get_catname( $default_cat_id )), js_escape( get_catname( $default_link_cat_id ) ) ) . "' );\" class='delete'>".__( 'Delete' )."</a>";
     747                        $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll of its posts will go into the default category of '%s'\nAll of its bookmarks will go into the default category of '%s'.\n'OK' to delete, 'Cancel' to stop." ), js_escape( $category->cat_name ), js_escape( get_catname( $default_cat_id )), js_escape( get_catname( $default_link_cat_id ) ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>";
    748748                else
    749                         $edit .= "<td style='text-align:center'>".__( "Default" );
     749                        $edit .= "<td style='text-align:center'>".__( 'Default' );
    750750        } else
    751751                $edit = '';
    752752
     
    791791    <td><?php if ( '0000-00-00 00:00:00' ==$post->post_modified ) _e('Unpublished'); else echo mysql2date( 'Y-m-d g:i a', $post->post_modified ); ?></td>
    792792        <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e( 'View' ); ?></a></td>
    793793    <td><?php if ( current_user_can( 'edit_page', $id ) ) { echo "<a href='page.php?action=edit&amp;post=$id' class='edit'>" . __( 'Edit' ) . "</a>"; } ?></td>
    794     <td><?php if ( current_user_can( 'delete_page', $id ) ) { echo "<a href='" . wp_nonce_url( "page.php?action=delete&amp;post=$id", 'delete-page_' . $id ) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf( __("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop." ), js_escape( get_the_title() ) ) . "' );\">" . __( 'Delete' ) . "</a>"; } ?></td>
     794    <td><?php if ( current_user_can( 'delete_page', $id ) ) { echo "<a href='" . wp_nonce_url( "page.php?action=delete&amp;post=$id", 'delete-page_' . $id ) .  "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . js_escape(sprintf( __("You are about to delete the '%s' page.\n'OK' to delete, 'Cancel' to stop." ), js_escape( get_the_title() ) )) . "' );\">" . __( 'Delete' ) . "</a>"; } ?></td>
    795795  </tr>
    796796
    797797<?php
     
    820820        $r .= "\n\t\t<td align='center'>";
    821821        if ( $numposts > 0 ) {
    822822                $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
    823                 $r .= sprintf( __('View %1$s %2$s' ), $numposts, __ngettext( 'post', 'posts', $numposts ));
     823                $r .= sprintf(__n( 'View %s post', 'View %s posts', $numposts ), $numposts);
    824824                $r .= '</a>';
    825825        }
    826826        $r .= "</td>\n\t\t<td>";
     
    10631063<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
    10641064<?php
    10651065        if ( $edit ) {
    1066                 _e( 'Existing timestamp' );
    1067                 //echo ': ' . $wp_locale->get_month( $mm ) . "$jj, $aa @ $hh:$mn";
    1068                 echo sprintf( __(': %1$s %2$s, %3$s @ %4$s:%5$s' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );
     1066                printf( __('Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );
    10691067        }
    10701068?>
    10711069</fieldset>
  • wp-admin/install.php

     
    7070                $public = (int) $_POST['blog_public'];
    7171                // check e-mail address
    7272                if (empty($admin_email)) {
    73                         die(__("<strong>ERROR</strong>: please type your e-mail address"));
     73                        die(__('<strong>ERROR</strong>:').' '.__('Please type your e-mail address'));
    7474                } else if (!is_email($admin_email)) {
    75                         die(__("<strong>ERROR</strong>: the e-mail address isn't correct"));
     75                        die(__('<strong>ERROR</strong>:').' '.__('The e-mail address isn&8217;t correct'));
    7676                }
    7777
    7878?>
     
    107107
    108108<p id="footer"><?php _e('<a href="http://wordpress.org/">WordPress</a>, personal publishing platform.'); ?></p>
    109109</body>
    110 </html>
    111  No newline at end of file
     110</html>