[freeside-commits] branch FREESIDE_3_BRANCH updated. 376774ee76640c2115aec44416e02d256117c699

Mark Wells mark at 420.am
Wed Oct 23 15:27:30 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  376774ee76640c2115aec44416e02d256117c699 (commit)
      from  26d0d6c431a941d966caf00783d3d398b8816f3a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 376774ee76640c2115aec44416e02d256117c699
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Oct 23 15:17:26 2013 -0700

    localization hook for payinfo descriptions, #24850

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 66d98c2..4e34ef4 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -3070,7 +3070,8 @@ sub _items_payments {
     my $cust_pay = $obj->isa('FS::cust_pay') ? $obj : $obj->cust_pay;
     my $desc = $self->mt('Payment received').' '.
                time2str($date_format, $cust_pay->_date );
-    $desc .= $self->mt(' via ' . $cust_pay->payby_payinfo_pretty)
+    $desc .= $self->mt(' via ') .
+             $cust_pay->payby_payinfo_pretty( $self->cust_main->locale )
       if $detailed;
 
     push @b, {
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index 5c4acf7..ac14347 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -230,7 +230,7 @@ sub payinfo_check {
 
 }
 
-=item payby_payinfo_pretty
+=item payby_payinfo_pretty [ LOCALE ]
 
 Returns payment method and information (suitably masked, if applicable) as
 a human-readable string, such as:
@@ -245,22 +245,25 @@ or
 
 sub payby_payinfo_pretty {
   my $self = shift;
+  my $locale = shift;
+  my $lh = FS::L10N->get_handle($locale);
   if ( $self->payby eq 'CARD' ) {
-    'Card #'. $self->paymask;
+    $lh->maketext('Card #') . $self->paymask;
   } elsif ( $self->payby eq 'CHEK' ) {
-    'E-check acct#'. $self->payinfo;
+    $lh->maketext('E-check acct#') . $self->payinfo;
   } elsif ( $self->payby eq 'BILL' ) {
-    'Check #'. $self->payinfo;
+    $lh->maketext('Check #') . $self->payinfo;
   } elsif ( $self->payby eq 'PREP' ) {
-    'Prepaid card #'. $self->payinfo;
+    $lh->maketext('Prepaid card #') . $self->payinfo;
   } elsif ( $self->payby eq 'CASH' ) {
-    'Cash '. $self->payinfo;
+    $lh->maketext('Cash') . ' ' . $self->payinfo;
   } elsif ( $self->payby eq 'WEST' ) {
-    'Western Union'; #. $self->payinfo;
+    # does Western Union localize their name?
+    $lh->maketext('Western Union');
   } elsif ( $self->payby eq 'MCRD' ) {
-    'Manual credit card'; #. $self->payinfo;
+    $lh->maketext('Manual credit card');
   } elsif ( $self->payby eq 'PPAL' ) {
-    'PayPal transaction#' . $self->order_number;
+    $lh->maketext('PayPal transaction#') . $self->order_number;
   } else {
     $self->payby. ' '. $self->payinfo;
   }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_bill.pm     |    3 ++-
 FS/FS/payinfo_Mixin.pm |   21 ++++++++++++---------
 2 files changed, 14 insertions(+), 10 deletions(-)




More information about the freeside-commits mailing list