internationalization/localization, RT12515
authorlevinse <levinse>
Tue, 17 May 2011 05:00:44 +0000 (05:00 +0000)
committerlevinse <levinse>
Tue, 17 May 2011 05:00:44 +0000 (05:00 +0000)
15 files changed:
httemplate/docs/cvv2.html
httemplate/view/cust_main/attachments.html
httemplate/view/cust_main/notes.html
httemplate/view/cust_main/one_time_charge_link.html
httemplate/view/cust_main/packages/package.html
httemplate/view/cust_main/packages/services.html
httemplate/view/cust_main/payment_history.html
httemplate/view/cust_main/payment_history/attempted_payment.html
httemplate/view/cust_main/payment_history/credit.html
httemplate/view/cust_main/payment_history/payment.html
httemplate/view/cust_main/payment_history/pending_payment.html
httemplate/view/cust_main/payment_history/refund.html
httemplate/view/cust_main/payment_history/voided_payment.html
httemplate/view/cust_pay.html
httemplate/view/svc_acct.cgi

index 199aadf..6025a67 100644 (file)
@@ -9,7 +9,7 @@
   <BR><BR>
   <TABLE BORDER=0 CELLSPACING=4>
     <TR>
-      <TH><% mt('Visa/MasterCard/Discover') |h %></TH>
+      <TH><% mt('Visa / MasterCard / Discover') |h %></TH>
       <TH><% mt('American Express') |h %></TH>
     </TR>
     <TR>
index bdd4f59..570b651 100755 (executable)
@@ -1,19 +1,19 @@
 % if ( scalar(@attachments) ) {
 
-  <% include('/elements/init_overlib.html') %>
+  <& /elements/init_overlib.html &>
 
-  <% include("/elements/table-grid.html") %>
+  <& /elements/table-grid.html &>
 
   <TR>
-    <TH CLASS="grid" BGCOLOR="#cccccc">Date</TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Date') |h %></TH>
 %   if ( $conf->exists('cust_main_note-display_times') ) {
-      <TH CLASS="grid" BGCOLOR="#cccccc">Time</TH>
+      <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Time') |h %></TH>
 %   }
-    <TH CLASS="grid" BGCOLOR="#cccccc">Person</TH>
-    <TH CLASS="grid" BGCOLOR="#cccccc">Filename</TH>
-    <TH CLASS="grid" BGCOLOR="#cccccc">Description</TH>
-    <TH CLASS="grid" BGCOLOR="#cccccc">Type</TH>
-    <TH CLASS="grid" BGCOLOR="#cccccc">Size</TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Person') |h %></TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Filename') |h %></TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Description') |h %></TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Type') |h %></TH>
+    <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Size') |h %></TH>
     <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
   </TR>
 
 %       my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
 %                           "custnum=$custnum;attachnum=$attachnum;".
 %                           "undelete=1",
-%                           'Undelete attachment');
-%       $edit .= qq!&nbsp; <A HREF="javascript:void(0);" $clickjs>(undelete)</A>!;
+%                           mt('Undelete attachment'));
+%       $edit .= linkstr($clickjs, mt('undelete'));
 %     }
 %     if ($curuser->access_right('Purge attachment')) {
 %       my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
 %                           "custnum=$custnum;attachnum=$attachnum;".
 %                           "purge=1",
-%                           'Purge attachment',
-%                           'Permanently remove this file?');
-%       $edit .= qq!&nbsp; <A HREF="javascript:void(0);" $clickjs>(purge)</A>!;
+%                           mt('Purge attachment'),
+%                           mt('Permanently remove this file?') );
+%       $edit .= linkstr($clickjs,mt('purge'));
 %     }
 %   }
 %   else { # you can download or edit it
 %     if ($curuser->access_right('Edit attachment') ) {
 %       my $clickjs = popup('edit/cust_main_attach.cgi?'.
 %                           "custnum=$custnum;attachnum=$attachnum",
-%                           'Edit attachment properties');
-%       $edit .= qq!&nbsp; <A HREF="javascript:void(0);" $clickjs>(edit)</A>!;
+%                           mt('Edit attachment properties'));
+%       $edit .= linkstr($clickjs,mt('edit'));
 %     }
 %     if($curuser->access_right('Delete attachment') ) {
 %       my $clickjs = popup('edit/process/cust_main_attach.cgi?'.
 %                           "custnum=$custnum;attachnum=$attachnum;delete=1",
 %                           'Delete attachment',
 %                           'Delete this file?');
-%       $edit .= qq!&nbsp; <A HREF="javascript:void(0);" $clickjs>(delete)</A>!;
+%       $edit .= linkstr($clickjs,mt('delete'));
 %     }
 %     if ($curuser->access_right('Download attachment') ) {
-%       $edit .= qq!&nbsp; <A HREF="!.popurl(1).'attachment.html?'.$attachnum.qq!">(download)</A>!;
+%       $edit .= qq!&nbsp; <A HREF="!.popurl(1).'attachment.html?'.$attachnum.qq!">(!
+%                               . mt('download') .')</A>';
 %     }
 %   }
 
@@ -131,6 +132,11 @@ sub note_datestr {
   $strip;
 }
 
+sub linkstr {
+    my ($clickjs, $label) = (shift,shift);
+    '&nbsp; <A HREF="javascript:void(0);" '. $clickjs . '>(' . mt($label) . ')</A>';
+}
+
 sub size_units {
   my $bytes = shift;
   return $bytes if $bytes < 1024;
index 3a4b05a..81ba6fb 100755 (executable)
@@ -63,8 +63,7 @@
 %
 %   my $edit = '';
 %   if ($curuser->access_right('Edit customer note') ) {
-%     my $editlabel = mt('edit');
-%     $edit = qq! <A HREF="javascript:void(0);" $clickjs>($editlabel)</A>!;
+%     $edit = qq! <A HREF="javascript:void(0);" $clickjs>(!.mt('edit').')</A>';
 %   }
 %
 % if ( $last_classnum != $note->classnum && !$skipheader ) {
index b3defa2..abb9a43 100644 (file)
@@ -76,8 +76,8 @@ function taxoverridequickchargemagic() {
 
 <% include('/elements/popup_link.html', { 
      'action'      => $p.'edit/quick-charge.html?custnum='. $cust_main->custnum,
-     'label'       => 'One-time charge',
-     'actionlabel' => 'One-time charge',
+     'label'       => mt('One-time charge'),
+     'actionlabel' => mt('One-time charge'),
      'color'       => '#333399',
      'width'       => 763,
      'height'      => 460, #more for more room for lines of add'l description?
index d6cee73..c79742b 100644 (file)
@@ -229,12 +229,10 @@ sub pkg_change_location_link {
   );
 }
 
-sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit&nbsp;dates', @_ ); }
+sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', mt('Edit dates'), @_ ); }
 
 sub pkg_discount_link {
   my $cust_pkg = shift or return '';
-  #my $part_pkg = shift;
-  #my $custnum = $cust_pkg->custnum;
   include( '/elements/popup_link-cust_pkg.html',
     'action'      => $p.'edit/cust_pkg_discount.html',
     'label'       => mt('Discount'),
index 50e1c15..de89462 100644 (file)
@@ -106,11 +106,10 @@ sub svc_provision_link {
                     'part_svc' => $part_svc, 
                     'query'    => $pkgnum_svcpart,
                   );
-    #$url = "${p}edit/$svcpart->{svcdb}.cgi?$pkgnum_svcpart";
   }
 
   my $link = qq!<A CLASS="provision" HREF="$url">!.
-             "Provision&nbsp;$svc_nbsp&nbsp;($num_avail)</A>";
+             mt("Provision [_1] ([_2])",$svc_nbsp,$num_avail).'</A>';
   if ( $opt->{'legacy_link'}
        && $curuser->access_right('View/link unlinked services')
      )
@@ -118,18 +117,18 @@ sub svc_provision_link {
     $link .= '<BR>'.
              qq!<A CLASS="provision" HREF="${p}misc/link.cgi?!.
              qq!$pkgnum_svcpart">!.
-            "Link&nbsp;to&nbsp;legacy&nbsp;$svc_nbsp&nbsp;($num_avail)</A>";
+            mt("Link to legacy [_1] ([_2])",$svc_nbsp,$num_avail).'</A>';
   }
   $link;
 }
 
 my %hints = (
-svc_acct      => '(user or email)',
-svc_domain    => '(domain)',
-svc_broadband => '(ip or mac)',
-svc_forward   => '(email)',
-svc_phone     => '(phone)',
-svc_pbx       => '(phone)',
+svc_acct      => mt('(user or email)'),
+svc_domain    => mt('(domain)'),
+svc_broadband => mt('(ip or mac)'),
+svc_forward   => mt('(email)'),
+svc_phone     => mt('(phone)'),
+svc_pbx       => mt('(phone)'),
 );
 
 </%init>
index a3b9b50..4a49bfd 100644 (file)
@@ -471,13 +471,28 @@ sub translate_payby_refund {
     my %payby = (
         BILL    => $payinfo ? mt('Check #') : mt('Check'),
         CHEK    => mt('Electronic check '),
-        CARD    => 'CARD ',
-        COMP    => 'COMP ',
+        CARD    => mt('Credit card #'),
+        COMP    => mt('Complimentary by '),
     );
     $payby = (exists $payby{$payby}) ? $payby{$payby} : $payby; 
     $payby;
 };
 
+sub translate_payinfo {
+    my $object = shift;
+    my $payby = $object->payby;
+    my $payinfo = $object->payinfo;
+
+    if ( $payby eq 'CARD' ) {
+        $payinfo = $object->paymask;
+    } elsif ( $payby eq 'CHEK' ) {
+        my( $account, $aba ) = split('@', $object->paymask );
+        $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
+    }
+
+    ($payby,$payinfo);
+}
+
 sub areyousure_link {
     my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
     ' (<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>)';
index 1a705b7..f044fc0 100644 (file)
@@ -3,22 +3,7 @@
 
 my( $cust_pay_pending, %opt ) = @_;
 
-my $date_format = $opt{'date_format'} || '%m/%d/%Y';
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-my $payby = $cust_pay_pending->payby;
-
-my $payinfo;
-if ( $payby eq 'CARD' ) {
-  $payinfo = $cust_pay_pending->paymask;
-} elsif ( $payby eq 'CHEK' ) {
-  my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
-  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
-} else {
-  $payinfo = $cust_pay_pending->payinfo;
-}
-
+my ($payby,$payinfo) = translate_payinfo($cust_pay_pending);
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
index ffe6133..f2b29b0 100644 (file)
@@ -7,6 +7,7 @@ my( $cust_credit, %opt ) = @_;
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
 my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
 my $curuser = $FS::CurrentUser::CurrentUser;
 
 my @cust_credit_bill = $cust_credit->cust_credit_bill;
@@ -74,23 +75,20 @@ if (    scalar(@cust_credit_bill)   == 0
   foreach my $app ( sort { $a->_date <=> $b->_date }
                          ( @cust_credit_bill, @cust_credit_refund ) ) {
     if ( $app->isa('FS::cust_credit_bill') ) {
-      $desc .= '&nbsp;&nbsp;'.
-               '$'. $app->amount.
-               ' '. $app->applied_to_invoice.
-               '<BR>';
-               #' on '. time2str($date_format, $app->_date).
+      $desc .= '&nbsp;&nbsp;' . $money_char . $app->amount . ' '
+                    . $app->applied_to_invoice . '<BR>';
     } elsif ( $app->isa('FS::cust_credit_refund') ) {
-      $desc .= '&nbsp;&nbsp;'.
-               '$'. $app->amount.
-               mt(" refunded on [_1]", time2str($date_format, $app->_date) ).
-               '<BR>';
+      $desc .= '&nbsp;&nbsp;' .
+               mt("[_1][_2] refunded on [_3]", $money_char, $app->amount,
+                    time2str($date_format, $app->_date) ) . '<BR>';
     } else {
       die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund";
     }
   }
   if ( $cust_credit->credited > 0 ) {
-    $desc .= '&nbsp;&nbsp;<B><FONT COLOR="#FF0000">$'.
-             $cust_credit->credited. ' unapplied</FONT></B>';
+    $desc .= '&nbsp;&nbsp;<B><FONT COLOR="#FF0000">' .
+              mt("[_1][_2] unapplied", $money_char, $cust_credit->credited) .
+              '</FONT></B>';
     if ( $curuser->access_right('Apply credit') ) {
       if ( $cust_credit->cust_main->total_owed > 0 ) {
         $apply = ' ('.
index 7df16cf..43f0afb 100644 (file)
@@ -7,22 +7,13 @@ my( $cust_pay, %opt ) = @_;
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
 my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
 my $curuser = $FS::CurrentUser::CurrentUser;
 
-my $payby = $cust_pay->payby;
-
-my $payinfo;
-if ( $payby eq 'CARD' ) {
-  $payinfo = $cust_pay->paymask;
-} elsif ( $payby eq 'CHEK' ) {
-  my( $account, $aba ) = split('@', $cust_pay->paymask );
-  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
-} else {
-  $payinfo = $cust_pay->payinfo;
-}
 my @cust_bill_pay = $cust_pay->cust_bill_pay;
 my @cust_pay_refund = $cust_pay->cust_pay_refund;
 
+my ($payby,$payinfo) = translate_payinfo($cust_pay);
 my $target = "$payby$payinfo";
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
@@ -40,7 +31,7 @@ if ($conf->exists('cust_bill_pay_pkg-manual')) {
   %cust_bill_pay_height = ('height' => 436);
 }
 
-my( $apply, $ext ) = ( '', '', '', '' );
+my $apply = '';
 
 my $otaker = $cust_pay->otaker;
 $otaker = '<i>auto billing</i>'          if $otaker eq 'fs_daily';
@@ -95,24 +86,21 @@ if (    scalar(@cust_bill_pay)   == 0
   foreach my $app ( sort { $a->_date <=> $b->_date }
                          ( @cust_bill_pay, @cust_pay_refund ) ) {
     if ( $app->isa('FS::cust_bill_pay') ) {
-      $desc .= '&nbsp;&nbsp;'.
-               '$'. $app->amount.
-               ' '. $app->applied_to_invoice.
-               '<BR>';
-               #' on '. time2str($date_format, $cust_bill_pay->_date).
+      $desc .= '&nbsp;&nbsp;' . $money_char . $app->amount . ' ' .
+                $app->applied_to_invoice . '<BR>';
     } elsif ( $app->isa('FS::cust_pay_refund') ) {
-      $desc .= '&nbsp;&nbsp;'.
-               '$'. $app->amount.
-               mt(" refunded on [_1]", time2str($date_format, $app->_date) ) .
-               '<BR>';
+      $desc .= '&nbsp;&nbsp;' .
+               mt("[_1][_2] refunded on [_3]", $money_char, $app->amount,
+                        time2str($date_format, $app->_date) ) . '<BR>';
     } else {
       die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund";
     }
   }
   if ( $cust_pay->unapplied > 0 ) {
     $desc .= '&nbsp;&nbsp;'.
-             '<B><FONT COLOR="#FF0000">$'.
-             $cust_pay->unapplied. ' unapplied</FONT></B>';
+             '<B><FONT COLOR="#FF0000">' .
+             mt("[_1][_2] unapplied", $money_char, $cust_pay->unapplied) .
+             '</FONT></B>';
     if ( $curuser->access_right('Apply payment') ) {
       if ( $cust_pay->cust_main->total_owed > 0 ) {
         $apply = ' ('.
@@ -164,8 +152,8 @@ if (    $cust_pay->closed !~ /^Y/i
 ) {
   $refund = qq! (<A HREF="${p}edit/cust_refund.cgi?payby=$1;!.
             qq!paynum=!. $cust_pay->paynum. '"'.
-            qq! TITLE="Send a refund for this payment to the payment gateway"!.
-            qq!>refund</A>)!;
+            qq! TITLE="! .mt('Send a refund for this payment to the payment gateway') 
+            . '">' . mt('refund') . '</A>)';
 }
 
 my $void = '';
index 3da5a62..6c7c103 100644 (file)
@@ -7,18 +7,7 @@ my $conf = new FS::Conf;
 
 my $curuser = $FS::CurrentUser::CurrentUser;
 
-my $payby = $cust_pay_pending->payby;
-
-my $payinfo;
-if ( $payby eq 'CARD' ) {
-  $payinfo = $cust_pay_pending->paymask;
-} elsif ( $payby eq 'CHEK' ) {
-  my( $account, $aba ) = split('@', $cust_pay_pending->paymask );
-  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
-} else {
-  $payinfo = $cust_pay_pending->payinfo;
-}
-
+my ($payby, $payinfo) = translate_payinfo($cust_pay_pending);
 my $target = "$payby$payinfo";
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
@@ -33,7 +22,7 @@ my %statusaction = (
 my $edit_pending =
   $FS::CurrentUser::CurrentUser->access_right('Edit customer pending payments');
 
-my $status = "Status: ".$cust_pay_pending->status;
+my $status = mt("Status: [_1]",$cust_pay_pending->status);
 
 my $action = $statusaction{$cust_pay_pending->status};
 
index 813836b..c73d51e 100644 (file)
@@ -11,7 +11,6 @@ my $payby = $cust_refund->payby;
 my $payinfo = $payby eq 'CARD'
                 ? $cust_refund->paymask
                 : $cust_refund->payinfo;
-
 $payby = translate_payby_refund($payby,$payinfo);
 
 my $refund = mt("Refund by [_1]",$cust_refund->otaker);
@@ -29,7 +28,6 @@ my $view =
                ).
    ')';
 
-
 my $delete = '';
 $delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refundnum,
                            mt('Are you sure you want to delete this refund?'),
index f4ffc23..3c2098d 100644 (file)
@@ -13,18 +13,7 @@ my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
 my $curuser = $FS::CurrentUser::CurrentUser;
 
-my $payby = $cust_pay_void->payby;
-
-my $payinfo;
-if ( $payby eq 'CARD' ) {
-  $payinfo = $cust_pay_void->paymask;
-} elsif ( $payby eq 'CHEK' ) {
-  my( $account, $aba ) = split('@', $cust_pay_void->paymask );
-  $payinfo = mt("ABA [_1], Acct #[_2]",$aba,$account);
-} else {
-  $payinfo = $cust_pay_void->payinfo;
-}
-
+my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
 
index 0fb514a..f7f2ea2 100644 (file)
@@ -20,8 +20,7 @@
   <BR><BR>
 % } elsif ( $link eq 'email' ) {
 %  if ( $email_error ) {
-      <& /elements/header-popup.html, mt("Error re-emailing receipt") &>
-%       warn "Error re-emailing receipt: $email_error";
+      <& /elements/header-popup.html, mt("Error re-emailing receipt: [_1]", $email_error) &>
 %  } else {
       <& /elements/header-popup.html, mt("Re-emailed receipt") &>
 %  }
index 47dc369..fc6d812 100755 (executable)
@@ -1,6 +1,6 @@
 % if ( $custnum ) { 
 
-  <& /elements/header.html, mt("View $svc account") &>
+  <& /elements/header.html, mt("View [_1] account",$svc) &>
   <& /elements/small_custview.html, $custnum, '', 1,
      "${p}view/cust_main.cgi" &> 
   <BR>
@@ -10,7 +10,7 @@
 
   <SCRIPT>
   function areyousure(href) {
-      if (confirm("<% $delmsg %>") == true)
+      if (confirm(<% $delmsg |js_string %>) == true)
           window.location.href = href;
   }
   </SCRIPT>