Skip to content

Commit

Permalink
Translator notes and equals sign alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Oct 7, 2019
1 parent bf47ae2 commit 1c54fd6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/gateways/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,21 @@ function mt_paypal_ipn() {
if ( ( $receiver && ( strtolower( $receiver_email ) != $receiver ) ) || $payment_currency != $options['mt_currency'] || false === $value_match ) {
// Translators: Item Number of payment triggering error.
if ( $price !== $value_match ) {
// Translators: price paid, price expected.
$error_msg[] = sprintf( __( 'Price paid did not match the price expected: %1$s paid vs %2$s expected.', 'my-tickets' ), $price, $value_match );
}
if ( strtolower( $receiver_email ) != $receiver ) {
// Translators: email provided by PayPal, email in My Tickets settings.
$error_msg[] = sprintf( __( 'Receiver Email and PayPal Email did not match: %1$s vs %2$s. Please check that the email in your My Tickets settings matches the primary email in your PayPal account.', 'my-tickets' ), $receiver_email, $receiver );
}
if ( $payment_currency != $options['mt_currency'] ) {
// Translators: currency received, currency expected.
$error_msg[] = sprintf( __( 'Currency received did not match the currency expected: %1$s vs %2$s.', 'my-tickets' ), $payment_currency, $options['mt_currency'] );
}
foreach ( $error_msg as $msg ) {
$messages .= "\n\n" . $msg;
}
// Translators: purchase ID.
wp_mail( $options['mt_to'], __( 'Payment Conditions Error', 'my-tickets' ), sprintf( __( 'There were errors processing payment on purchase ID %s:', 'my-tickets' ), $item_number ) . $messages . "\n" . print_r( $data, 1 ) );
status_header( 200 ); // Why 200? Because that's the only way to stop PayPal.
die;
Expand Down
4 changes: 2 additions & 2 deletions src/mt-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,8 @@ function mt_generate_cart_table( $cart, $format = 'cart' ) {
} else {
$hidden = '';
}
$total = $total + ( $price * $count );
$custom = apply_filters( 'mt_show_in_cart_fields', '', $event_id );
$total = $total + ( $price * $count );
$custom = apply_filters( 'mt_show_in_cart_fields', '', $event_id );
// Translators: (number of tickets) at (price per ticket).
$cart_message = sprintf( __( '%1$s at %2$s', 'my-tickets' ), "<span class='count' data-limit='$max'>$count</span>", $currency . apply_filters( 'mt_money_format', $price ) );
$output .= "
Expand Down
15 changes: 8 additions & 7 deletions src/mt-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,17 @@ function mt_format_purchase( $purchase, $format = false, $purchase_id = false )
$tickets_list = '';
foreach ( $tickets as $type => $ticket ) {
if ( $ticket['count'] > 0 ) {
$price = $ticket['price'];
$type = apply_filters( 'mt_ticket_type_label', ucfirst( str_replace( '-', ' ', $type ) ) );
$price = $price - $handling;
$discount = mt_calculate_discount( $price, $event_id, $purchase_id );
$total = ( $discount !== $price ) ? $total + $discount * $ticket['count'] : $total + $price * $ticket['count'];
$display_app = '';
$price = $ticket['price'];
$type = apply_filters( 'mt_ticket_type_label', ucfirst( str_replace( '-', ' ', $type ) ) );
$price = $price - $handling;
$discount = mt_calculate_discount( $price, $event_id, $purchase_id );
$total = ( $discount !== $price ) ? $total + $discount * $ticket['count'] : $total + $price * $ticket['count'];
$display_app = '';
// Match formats so comparison is valid.
if ( sprintf( '%01.2f', $discount ) !== sprintf( '%01.2f', $price ) ) {
// Translators: original ticket price, before discounts.
$discount = strip_tags( apply_filters( 'mt_money_format', $discount ) );
$discount = strip_tags( apply_filters( 'mt_money_format', $discount ) );
// Translators: discounted cost of ticket.
$display_app = ' (' . sprintf( __( 'Discounted to %s', 'my-tickets' ), $discount ) . ')';
}
$display_price = strip_tags( apply_filters( 'mt_money_format', $price ) ) . $display_app;
Expand Down

0 comments on commit 1c54fd6

Please sign in to comment.