Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[i18n] Status changed from %s to %s not translated #1877

Closed
fxbenard opened this Issue Jan 8, 2014 · 7 comments

Comments

Projects
None yet
3 participants
Collaborator

fxbenard commented Jan 8, 2014

includes/payments/actions.php:114

the %s aren't getting translated

@ghost ghost assigned ghost1227 Jan 14, 2014

Member

ghost1227 commented Jan 15, 2014

I can't duplicate this...

Screenshot

Owner

pippinsplugins commented Jan 15, 2014

@ghost1227 Are the labels passed for "Pending" and "Complete" passed through __()? I don't think they are.

Member

ghost1227 commented Jan 15, 2014

Ohhh he literally meant the LABELS aren't translated >_< Misunderstood, my bad.

Member

ghost1227 commented Jan 15, 2014

That works too...

Screenshot

Owner

pippinsplugins commented Jan 17, 2014

The statuses are definitely passed through __():

/**
 * Retrieves all available statuses for payments.
 *
 * @since 1.0.8.1
 * @return array $payment_status All the available payment statuses
 */
function edd_get_payment_statuses() {
    $payment_statuses = array(
        'pending'   => __( 'Pending', 'edd' ),
        'publish'   => __( 'Complete', 'edd' ),
        'refunded'  => __( 'Refunded', 'edd' ),
        'failed'    => __( 'Failed', 'edd' ),
        'abandoned' => __( 'Abandoned', 'edd' ),
        'revoked'   => __( 'Revoked', 'edd' )
    );

    return apply_filters( 'edd_payment_statuses', $payment_statuses );
}

and

/**
 * Record payment status change
 *
 * @since 1.4.3
 * @param int $payment_id the ID number of the payment
 * @param string $new_status the status of the payment, probably "publish"
 * @param string $old_status the status of the payment prior to being marked as "complete", probably "pending"
 * @return void
 */
function edd_record_status_change( $payment_id, $new_status, $old_status ) {

    // Get the list of statuses so that status in the payment note can be translated
    $stati      = edd_get_payment_statuses();
    $old_status = isset( $stati[ $old_status ] ) ? $stati[ $old_status ] : $old_status;
    $new_status = isset( $stati[ $new_status ] ) ? $stati[ $new_status ] : $new_status;

    $status_change = sprintf( __( 'Status changed from %s to %s', 'edd' ), $old_status, $new_status );

    edd_insert_payment_note( $payment_id, $status_change );
}
add_action( 'edd_update_payment_status', 'edd_record_status_change', 100, 3 );
Member

ghost1227 commented Mar 6, 2014

@pippinsplugins Unless you see a reason not to, I'm going to close this...

@pippinsplugins pippinsplugins removed this from the 2.0 milestone Mar 6, 2014

Owner

pippinsplugins commented Mar 6, 2014

Nope, let's close.

On Thu, Mar 6, 2014 at 10:05 AM, Ghost1227 notifications@github.com wrote:

@pippinsplugins https://github.com/pippinsplugins Unless you see a
reason not to, I'm going to close this...

Reply to this email directly or view it on GitHubhttps://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/1877#issuecomment-36903199
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment