From 93519f9371b41ded713a93fba031ed7a361be04c Mon Sep 17 00:00:00 2001 From: levinse Date: Tue, 17 May 2011 05:00:44 +0000 Subject: [PATCH] internationalization/localization, RT12515 --- httemplate/docs/cvv2.html | 2 +- httemplate/view/cust_main/attachments.html | 42 ++++++++++++---------- httemplate/view/cust_main/notes.html | 3 +- .../view/cust_main/one_time_charge_link.html | 4 +-- httemplate/view/cust_main/packages/package.html | 4 +-- httemplate/view/cust_main/packages/services.html | 17 +++++---- httemplate/view/cust_main/payment_history.html | 19 ++++++++-- .../payment_history/attempted_payment.html | 17 +-------- .../view/cust_main/payment_history/credit.html | 20 +++++------ .../view/cust_main/payment_history/payment.html | 38 +++++++------------- .../cust_main/payment_history/pending_payment.html | 15 ++------ .../view/cust_main/payment_history/refund.html | 2 -- .../cust_main/payment_history/voided_payment.html | 13 +------ httemplate/view/cust_pay.html | 3 +- httemplate/view/svc_acct.cgi | 4 +-- 15 files changed, 83 insertions(+), 120 deletions(-) diff --git a/httemplate/docs/cvv2.html b/httemplate/docs/cvv2.html index 199aadf07..6025a673f 100644 --- a/httemplate/docs/cvv2.html +++ b/httemplate/docs/cvv2.html @@ -9,7 +9,7 @@

- + diff --git a/httemplate/view/cust_main/attachments.html b/httemplate/view/cust_main/attachments.html index bdd4f5917..570b65120 100755 --- a/httemplate/view/cust_main/attachments.html +++ b/httemplate/view/cust_main/attachments.html @@ -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 &> - + % if ( $conf->exists('cust_main_note-display_times') ) { - + % } - - - - - + + + + + @@ -48,34 +48,35 @@ % my $clickjs = popup('edit/process/cust_main_attach.cgi?'. % "custnum=$custnum;attachnum=$attachnum;". % "undelete=1", -% 'Undelete attachment'); -% $edit .= qq!  (undelete)!; +% 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!  (purge)!; +% 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!  (edit)!; +% 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!  (delete)!; +% $edit .= linkstr($clickjs,mt('delete')); % } % if ($curuser->access_right('Download attachment') ) { -% $edit .= qq!  (download)!; +% $edit .= qq!  (! +% . mt('download') .')'; % } % } @@ -131,6 +132,11 @@ sub note_datestr { $strip; } +sub linkstr { + my ($clickjs, $label) = (shift,shift); + '  (' . mt($label) . ')'; +} + sub size_units { my $bytes = shift; return $bytes if $bytes < 1024; diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html index 3a4b05a36..81ba6fb3d 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -63,8 +63,7 @@ % % my $edit = ''; % if ($curuser->access_right('Edit customer note') ) { -% my $editlabel = mt('edit'); -% $edit = qq! ($editlabel)!; +% $edit = qq! (!.mt('edit').')'; % } % % if ( $last_classnum != $note->classnum && !$skipheader ) { diff --git a/httemplate/view/cust_main/one_time_charge_link.html b/httemplate/view/cust_main/one_time_charge_link.html index b3defa294..abb9a4384 100644 --- a/httemplate/view/cust_main/one_time_charge_link.html +++ b/httemplate/view/cust_main/one_time_charge_link.html @@ -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? diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index d6cee73d0..c79742b8b 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -229,12 +229,10 @@ sub pkg_change_location_link { ); } -sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit 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'), diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 50e1c1527..de8946248 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -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!!. - "Provision $svc_nbsp ($num_avail)"; + mt("Provision [_1] ([_2])",$svc_nbsp,$num_avail).''; if ( $opt->{'legacy_link'} && $curuser->access_right('View/link unlinked services') ) @@ -118,18 +117,18 @@ sub svc_provision_link { $link .= '
'. qq!!. - "Link to legacy $svc_nbsp ($num_avail)"; + mt("Link to legacy [_1] ([_2])",$svc_nbsp,$num_avail).''; } $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)'), ); diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index a3b9b508b..4a49bfddb 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -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); ' ('.$label.')'; diff --git a/httemplate/view/cust_main/payment_history/attempted_payment.html b/httemplate/view/cust_main/payment_history/attempted_payment.html index 1a705b7f8..f044fc0d4 100644 --- a/httemplate/view/cust_main/payment_history/attempted_payment.html +++ b/httemplate/view/cust_main/payment_history/attempted_payment.html @@ -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)" : ''; diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index ffe613340..f2b29b079 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -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 .= '  '. - '$'. $app->amount. - ' '. $app->applied_to_invoice. - '
'; - #' on '. time2str($date_format, $app->_date). + $desc .= '  ' . $money_char . $app->amount . ' ' + . $app->applied_to_invoice . '
'; } elsif ( $app->isa('FS::cust_credit_refund') ) { - $desc .= '  '. - '$'. $app->amount. - mt(" refunded on [_1]", time2str($date_format, $app->_date) ). - '
'; + $desc .= '  ' . + mt("[_1][_2] refunded on [_3]", $money_char, $app->amount, + time2str($date_format, $app->_date) ) . '
'; } else { die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund"; } } if ( $cust_credit->credited > 0 ) { - $desc .= '  $'. - $cust_credit->credited. ' unapplied'; + $desc .= '  ' . + mt("[_1][_2] unapplied", $money_char, $cust_credit->credited) . + ''; if ( $curuser->access_right('Apply credit') ) { if ( $cust_credit->cust_main->total_owed > 0 ) { $apply = ' ('. diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index 7df16cf87..43f0afbb0 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -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 = 'auto billing' 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 .= '  '. - '$'. $app->amount. - ' '. $app->applied_to_invoice. - '
'; - #' on '. time2str($date_format, $cust_bill_pay->_date). + $desc .= '  ' . $money_char . $app->amount . ' ' . + $app->applied_to_invoice . '
'; } elsif ( $app->isa('FS::cust_pay_refund') ) { - $desc .= '  '. - '$'. $app->amount. - mt(" refunded on [_1]", time2str($date_format, $app->_date) ) . - '
'; + $desc .= '  ' . + mt("[_1][_2] refunded on [_3]", $money_char, $app->amount, + time2str($date_format, $app->_date) ) . '
'; } else { die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund"; } } if ( $cust_pay->unapplied > 0 ) { $desc .= '  '. - '$'. - $cust_pay->unapplied. ' unapplied'; + '' . + mt("[_1][_2] unapplied", $money_char, $cust_pay->unapplied) . + ''; 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! (refund)!; + qq! TITLE="! .mt('Send a refund for this payment to the payment gateway') + . '">' . mt('refund') . ')'; } my $void = ''; diff --git a/httemplate/view/cust_main/payment_history/pending_payment.html b/httemplate/view/cust_main/payment_history/pending_payment.html index 3da5a6229..6c7c103d0 100644 --- a/httemplate/view/cust_main/payment_history/pending_payment.html +++ b/httemplate/view/cust_main/payment_history/pending_payment.html @@ -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}; diff --git a/httemplate/view/cust_main/payment_history/refund.html b/httemplate/view/cust_main/payment_history/refund.html index 813836b64..c73d51e01 100644 --- a/httemplate/view/cust_main/payment_history/refund.html +++ b/httemplate/view/cust_main/payment_history/refund.html @@ -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?'), diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index f4ffc23bd..3c2098d23 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -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)" : ''; diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html index 0fb514aa3..f7f2ea2d6 100644 --- a/httemplate/view/cust_pay.html +++ b/httemplate/view/cust_pay.html @@ -20,8 +20,7 @@

% } 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") &> % } diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index 47dc36919..fc6d81290 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -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" &>
@@ -10,7 +10,7 @@ -- 2.11.0
<% mt('Visa/MasterCard/Discover') |h %><% mt('Visa / MasterCard / Discover') |h %> <% mt('American Express') |h %>
Date<% mt('Date') |h %>Time<% mt('Time') |h %>PersonFilenameDescriptionTypeSize<% mt('Person') |h %><% mt('Filename') |h %><% mt('Description') |h %><% mt('Type') |h %><% mt('Size') |h %>