diff options
author | levinse <levinse> | 2011-05-17 05:00:44 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-05-17 05:00:44 +0000 |
commit | 93519f9371b41ded713a93fba031ed7a361be04c (patch) | |
tree | 3b00659886d3eece63b5d514f65691218ed4d7d7 /httemplate/view | |
parent | 5d5e197dd0c74b419a4c4cb0791bf23e68e4c3bb (diff) |
internationalization/localization, RT12515
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_main/attachments.html | 42 | ||||
-rwxr-xr-x | httemplate/view/cust_main/notes.html | 3 | ||||
-rw-r--r-- | httemplate/view/cust_main/one_time_charge_link.html | 4 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/package.html | 4 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/services.html | 17 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 19 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/attempted_payment.html | 17 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/credit.html | 20 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/payment.html | 38 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/pending_payment.html | 15 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/refund.html | 2 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/voided_payment.html | 13 | ||||
-rw-r--r-- | httemplate/view/cust_pay.html | 3 | ||||
-rwxr-xr-x | httemplate/view/svc_acct.cgi | 4 |
14 files changed, 82 insertions, 119 deletions
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 &> <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> @@ -48,34 +48,35 @@ % my $clickjs = popup('edit/process/cust_main_attach.cgi?'. % "custnum=$custnum;attachnum=$attachnum;". % "undelete=1", -% 'Undelete attachment'); -% $edit .= qq! <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! <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! <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! <A HREF="javascript:void(0);" $clickjs>(delete)</A>!; +% $edit .= linkstr($clickjs,mt('delete')); % } % if ($curuser->access_right('Download attachment') ) { -% $edit .= qq! <A HREF="!.popurl(1).'attachment.html?'.$attachnum.qq!">(download)</A>!; +% $edit .= qq! <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); + ' <A HREF="javascript:void(0);" '. $clickjs . '>(' . mt($label) . ')</A>'; +} + 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! <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 ) { 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!<A CLASS="provision" HREF="$url">!. - "Provision $svc_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 to legacy $svc_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> 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); ' (<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>)'; 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. - '<BR>'; - #' on '. time2str($date_format, $app->_date). + $desc .= ' ' . $money_char . $app->amount . ' ' + . $app->applied_to_invoice . '<BR>'; } elsif ( $app->isa('FS::cust_credit_refund') ) { - $desc .= ' '. - '$'. $app->amount. - mt(" refunded on [_1]", time2str($date_format, $app->_date) ). - '<BR>'; + $desc .= ' ' . + 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 .= ' <B><FONT COLOR="#FF0000">$'. - $cust_credit->credited. ' unapplied</FONT></B>'; + $desc .= ' <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 = ' ('. 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 = '<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 .= ' '. - '$'. $app->amount. - ' '. $app->applied_to_invoice. - '<BR>'; - #' on '. time2str($date_format, $cust_bill_pay->_date). + $desc .= ' ' . $money_char . $app->amount . ' ' . + $app->applied_to_invoice . '<BR>'; } elsif ( $app->isa('FS::cust_pay_refund') ) { - $desc .= ' '. - '$'. $app->amount. - mt(" refunded on [_1]", time2str($date_format, $app->_date) ) . - '<BR>'; + $desc .= ' ' . + 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 .= ' '. - '<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 = ''; 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 @@ <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") &> % } 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" &> <BR> @@ -10,7 +10,7 @@ <SCRIPT> function areyousure(href) { - if (confirm("<% $delmsg %>") == true) + if (confirm(<% $delmsg |js_string %>) == true) window.location.href = href; } </SCRIPT> |