Make WordPress Core

Ticket #34684: 34684.patch

File 34684.patch, 2.7 KB (added by ramiy, 9 years ago)
  • wp-admin/includes/class-wp-filesystem-ssh2.php

     
    114114                }
    115115
    116116                if ( ! $this->link ) {
    117                         $this->errors->add('connect', sprintf(__('Failed to connect to SSH2 Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
     117                        $this->errors->add( 'connect',
     118                                sprintf(
     119                                        /* translators: 1: hostname 2: port */
     120                                        __( 'Failed to connect to SSH2 Server %1$s:%2$s' ),
     121                                        $this->options['hostname'],
     122                                        $this->options['port']
     123                                )
     124                        );
    118125                        return false;
    119126                }
    120127
    121128                if ( !$this->keys ) {
    122129                        if ( ! @ssh2_auth_password($this->link, $this->options['username'], $this->options['password']) ) {
    123                                 $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username']));
     130                                $this->errors->add( 'auth',
     131                                        sprintf(
     132                                                /* translators: %s: user name */
     133                                                __( 'Username/Password incorrect for %s' ),
     134                                                $this->options['username']
     135                                        )
     136                                );
    124137                                return false;
    125138                        }
    126139                } else {
    127140                        if ( ! @ssh2_auth_pubkey_file($this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {
    128                                 $this->errors->add('auth', sprintf(__('Public and Private keys incorrect for %s'), $this->options['username']));
     141                                $this->errors->add( 'auth',
     142                                        sprintf(
     143                                                /* translators: %s: user name */
     144                                                __( 'Public and Private keys incorrect for %s' ),
     145                                                $this->options['username']
     146                                        )
     147                                );
    129148                                return false;
    130149                        }
    131150                }
     
    132151
    133152                $this->sftp_link = ssh2_sftp( $this->link );
    134153                if ( ! $this->sftp_link ) {
    135                         $this->errors->add( 'connect', sprintf( __( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %1$s:%2$s' ), $this->options['hostname'], $this->options['port'] ) );
     154                        $this->errors->add( 'connect',
     155                                sprintf(
     156                                        /* translators: 1: hostname 2: port */
     157                                        __( 'Failed to initialize a SFTP subsystem session with the SSH2 Server %1$s:%2$s' ),
     158                                        $this->options['hostname'],
     159                                        $this->options['port']
     160                                )
     161                        );
    136162                        return false;
    137163                }
    138164
     
    173199                        return false;
    174200
    175201                if ( ! ($stream = ssh2_exec($this->link, $command)) ) {
    176                         $this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command));
     202                        $this->errors->add( 'command',
     203                                sprintf(
     204                                        /* translators: %s: command */
     205                                        __( 'Unable to perform command: %s'),
     206                                        $command
     207                                )
     208                        );
    177209                } else {
    178210                        stream_set_blocking( $stream, true );
    179211                        stream_set_timeout( $stream, FS_TIMEOUT );