From f1802f4b19c6741b50007b56bbac13af61012fe5 Mon Sep 17 00:00:00 2001 From: levinse Date: Sun, 22 May 2011 21:48:32 +0000 Subject: [PATCH] internationalization/localization, RT12515 --- httemplate/browse/msgcat.cgi | 16 +++---- httemplate/index.html | 10 ++-- httemplate/loginout/logout.html | 4 +- httemplate/misc/cancel_cust.html | 44 ++++++++---------- httemplate/misc/cancel_pkg.html | 25 ++++------ httemplate/misc/change_pkg.cgi | 24 ++++------ httemplate/misc/cust_main-cancel.cgi | 2 +- httemplate/misc/order_pkg.html | 49 +++++++++----------- httemplate/misc/payment.cgi | 82 +++++++++++++++------------------ httemplate/misc/process/cancel_pkg.html | 6 +-- 10 files changed, 115 insertions(+), 147 deletions(-) diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi index 2c916dc9f..f71fadb9f 100755 --- a/httemplate/browse/msgcat.cgi +++ b/httemplate/browse/msgcat.cgi @@ -1,8 +1,8 @@ -<% include('/elements/header.html', "View Message catalog", menubar( - 'Edit message catalog' => $p. "edit/msgcat.cgi", -)) %> +<& /elements/header.html, emt("View Message catalog"), menubar( + emt('Edit message catalog') => $p. "edit/msgcat.cgi", +) &> <% $widget->html %> -<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> die "access denied" @@ -13,14 +13,12 @@ my $widget = new HTML::Widgets::SelectLayers( 'options' => { 'en_US'=>'en_US' }, 'layer_callback' => sub { my $layer = shift; - my $html = "
Messages for locale $layer
". table(). - "Code". - "Message"; + my $html = "
".emt("Messages for locale [_1]",$layer)."
". table(). + "".emt('Code')."". + "".emt('Message').""; $html .= "en_US Message" unless $layer eq 'en_US'; $html .= ''; - #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } - # qsearch('msgcat', { 'locale' => $layer } ) ) { foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { $html .= ''. $msgcat->msgnum. ''. ''. $msgcat->msgcode. ''. diff --git a/httemplate/index.html b/httemplate/index.html index c44880dba..450795972 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -1,8 +1,8 @@ -<& /elements/header.html, mt('Billing Main') &> +<& /elements/header.html, emt('Billing Main') &> -<% include('/elements/dashboard-install_welcome.html') %> +<& /elements/dashboard-install_welcome.html &> -<% include('/elements/dashboard-toplist.html') %> +<& /elements/dashboard-toplist.html &> % my $sth = dbh->prepare( % #"SELECT DISTINCT custnum FROM h_cust_main JOIN cust_main USING ( custnum ) @@ -21,14 +21,14 @@ % % if ( @custnums ) { - <% include('/elements/table-grid.html') %> + <& /elements/table-grid.html &> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; % my $bgcolor = $bgcolor2; - Customers I recently added or modified + <% mt('Customers I recently added or modified') |h %> % foreach my $custnum ( @custnums ) { diff --git a/httemplate/loginout/logout.html b/httemplate/loginout/logout.html index 130cf662a..a29454a2c 100644 --- a/httemplate/loginout/logout.html +++ b/httemplate/loginout/logout.html @@ -2,13 +2,13 @@ - <% "Logout page" %> + <% mt('Logout page') |h %>

- You have logged out. + <% mt('You have logged out') |h %>


diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html index b7ecccd7e..0e2b11541 100644 --- a/httemplate/misc/cancel_cust.html +++ b/httemplate/misc/cancel_cust.html @@ -1,13 +1,11 @@ -<% include('/elements/header-popup.html', 'Cancel customer' ) %> - -<% include('/elements/error.html') %> +<& /elements/header-popup.html, emt('Cancel customer') &> +<& /elements/error.html &>
- -

Permanently delete all services and cancel this customer? +

<% mt('Permanently delete all services and cancel this customer?') |h %> @@ -15,17 +13,17 @@ STYLE="margin-left:auto; margin-right:auto"> - + -
Cancel now<% mt('Cancel now') |h %>
Cancel on date:  - <% include('/elements/input-date-field.html', { + <% mt('Cancel on date: ') |h %> + <& /elements/input-date-field.html, { 'name' => 'expire', 'value' => time, - } ) %> + } &>
@@ -38,23 +36,30 @@ function toggle(val) { } toggle(false); -<% $ban %> +% if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { +% my $ban = "Ban this customer's "; +% $ban .= 'credit card' if $cust_main->payby =~ /^(CARD|DCRD)$/; +% $ban .= 'ACH account' if $cust_main->payby =~ /^(CHEK|DCHK)$/; +

+ <% mt($ban) |h %> +% } -<% include('/elements/tr-select-reason.html', +<& /elements/tr-select-reason.html, 'field' => 'reasonnum', 'reason_class' => 'C', 'cgi' => $cgi, 'control_button' => "document.getElementById('confirm_cancel_cust_button')", - ) -%> +&>

-          + +         +" onClick="parent.cClick();">

@@ -76,16 +81,5 @@ my $cust_main = qsearchs( { } ); die "No customer # $custnum" unless $cust_main; -my $ban = ''; -if ( $cust_main->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) { - $ban = '

'. - ' Ban this customer\'s '; - if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) { - $ban .= 'credit card'; - } elsif ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) { - $ban .= 'ACH account'; - } -} - diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html index 10c0e0d04..b6fe78522 100755 --- a/httemplate/misc/cancel_pkg.html +++ b/httemplate/misc/cancel_pkg.html @@ -1,31 +1,27 @@ -%# if ( $link eq 'popup' ) { - <% include('/elements/header-popup.html', $title ) %> -%# } else { -%# <% include("/elements/header.html", $title, '') %> -%# } +<& /elements/header-popup.html, emt($title) &> -<% include('/elements/error.html') %> +<& /elements/error.html &>

-

-<% ucfirst($method) %> <% $part_pkg->pkg_comment %> +<% emt(ucfirst($method)." [_1]", $part_pkg->pkg_comment) %> <% ntable("#cccccc", 2) %> % if ($method eq 'expire' || $method eq 'adjourn') { - <% $submit =~ /^(\w*)\s/ %> package on +% $submit =~ /^(\w*)\s/; + <% mt("$1 package on") |h %> - -
m/d/y + +
<% mt('m/d/y') |h %> -<% include('/elements/error.html') %> +<& /elements/error.html &> @@ -10,36 +10,32 @@ <% ntable('#cccccc') %> - Current package + <% mt('Current package') |h %> <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg |h %> - <% $part_pkg->comment |h %> - <% include('/elements/tr-select-cust-part_pkg.html', - 'pre_label' => 'New', + <& /elements/tr-select-cust-part_pkg.html, + 'pre_label' => emt('New'), 'curr_value' => scalar($cgi->param('pkgpart')), 'classnum' => $part_pkg->classnum, 'cust_main' => $cust_main, - #'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart, - ) - %> + &> - <% include('/elements/tr-select-cust_location.html', + <& /elements/tr-select-cust_location.html, 'cgi' => $cgi, 'cust_main' => $cust_main, - ) - %> + &> -<% include( '/elements/standardize_locations.html', +<& /elements/standardize_locations.html, 'form' => "OrderPkgForm", 'onlyship' => 1, 'no_company' => 1, 'callback' => 'document.OrderPkgForm.submit();', - ) -%> +&>
+<& /elements/header.html, emt("Customer cancelled") &> diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 4f511cc36..7d289c945 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -1,4 +1,4 @@ -<% include('/elements/header-popup.html', 'Order new package' ) %> +<& /elements/header-popup.html, emt('Order new package') &> @@ -7,7 +7,7 @@ -<% include('/elements/error.html') %> +<& /elements/error.html &> @@ -21,64 +21,61 @@ % if ( $part_pkg ) { - Package + <% mt('Package') |h %> <% $part_pkg->pkg_comment |h %> % } else { - <% include('/elements/tr-select-cust-part_pkg.html', + <& /elements/tr-select-cust-part_pkg.html, 'curr_value' => $pkgpart, 'classnum' => -1, 'cust_main' => $cust_main, 'onchange' => 'enable_order_pkg', - ) - %> + &> % } - Start date + <% mt('Start date') |h %> - <% include('/elements/input-date-field.html',{ + <& /elements/input-date-field.html,{ 'name' => 'start_date', 'format' => $date_format, 'value' => $start_date, 'noinit' => 1, - }) %> - (leave blank to start immediately) + } &> + (<% mt('leave blank to start immediately') |h %>) % if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { % my $what = lc(FS::payby->shortname($cust_main->payby)); - Disable automatic <% $what %> charge + <% mt("Disable automatic $what charge") |h %> % } % if ( $curuser->access_right('Discount customer package') ) { - <% include('/elements/tr-select-discount.html', + <& /elements/tr-select-discount.html, 'element_etc' => 'DISABLED', 'colspan' => 7, 'cgi' => $cgi, - ) - %> + &> % } % if ( $curuser->access_right('Waive setup fee') ) { - Waive setup fee + <% mt('Waive setup fee') |h %> % } % if ( $conf->exists('pkg_referral') ) { - <% include('/elements/tr-select-part_referral.html', + <& /elements/tr-select-part_referral.html, 'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum, 'disable_empty' => 1, 'multiple' => $conf->exists('pkg_referral-multiple'), 'colspan' => 7, - ) - %> + &> % } % if ( $cgi->param('lock_locationnum') ) { @@ -91,23 +88,22 @@ % } else { - <% include('/elements/tr-select-cust_location.html', + <& /elements/tr-select-cust_location.html, 'cgi' => $cgi, 'cust_main' => $cust_main, - ) - %> + &> % } - Contract end date + <% mt('Contract end date') |h %> - <% include('/elements/input-date-field.html',{ + <& /elements/input-date-field.html,{ 'name' => 'contract_end', 'format' => $date_format, 'value' => '', 'noinit' => 1, - }) %> + } &> @@ -115,13 +111,12 @@ % unless ( $cgi->param('lock_locationnum') ) { - <% include( '/elements/standardize_locations.html', + <& /elements/standardize_locations.html, 'form' => "OrderPkgForm", 'onlyship' => 1, 'no_company' => 1, 'callback' => 'document.OrderPkgForm.submit();', - ) - %> + &> % } diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi index aec68af45..36e8255f1 100644 --- a/httemplate/misc/payment.cgi +++ b/httemplate/misc/payment.cgi @@ -1,18 +1,16 @@ -<% include( '/elements/header.html', "Process $type{$payby} payment" ) %> -<% include( '/elements/small_custview.html', $cust_main, '', '', popurl(2) . "view/cust_main.cgi" ) %> +<& /elements/header.html, emt("Process [_1] payment",$type{$payby}) &> +<& /elements/small_custview.html, $cust_main, '', '', popurl(2) . "view/cust_main.cgi" &> -<% include('/elements/init_overlib.html') %> - -% #include( '/elements/table.html', '#cccccc' ) +<& /elements/init_overlib.html &> <% ntable('#cccccc') %> - Payment amount + <% mt('Payment amount') |h %> - +
<% $money_char %> $custnum, 'cgi' => $cgi - ) -%> +&> % if ( $payby eq 'CARD' ) { % @@ -85,13 +82,13 @@ % }
Card number<% mt('Card number') |h %> - + - + - + - <% include( '/elements/location.html', + <& /elements/location.html, 'object' => $cust_main, #XXX errors??? 'no_asterisks' => 1, - 'address1_label' => 'Card billing address', - ) - %> + 'address1_label' => emt('Card billing address'), + &> % } elsif ( $payby eq 'CHEK' ) { % @@ -153,34 +149,33 @@ - + - + - + - + % if ( $conf->exists('show_bankstate') ) { - - + % } else { @@ -190,8 +185,8 @@ % if ( $conf->exists('show_ss') ) { @@ -202,19 +197,18 @@ % if ( $conf->exists('show_stateid') ) { - - + % } else { @@ -228,7 +222,7 @@ @@ -245,7 +239,7 @@ @@ -255,24 +249,24 @@
Exp.<% mt('Exp.') |h %>
CVV2<% mt('CVV2') |h %> - (help) + (<% mt('help') |h %>)
Exact name on card<% mt('Exact name on card') |h %>
Account number<% mt('Account number') |h %> Type<% mt('Type') |h %>
ABA/Routing number<% mt('ABA/Routing number') |h %> - (help) + (<% mt('help') |h %>)
Bank name<% mt('Bank name') |h %>
Bank state<% include('/elements/select-state.html', + <% mt('Bank state') |h %><& /elements/select-state.html, 'disable_empty' => 0, - 'empty_label' => '(choose)', + 'empty_label' => emt('(choose)'), 'state' => $paystate, 'country' => $cust_main->country, 'prefix' => 'pay', - ) - %> + &>
- Account holder
- Social security or tax ID # + <% mt('Account holder') |h %>
+ <% mt('Social security or tax ID #') |h %>
- Account holder
- Driver’s license or state ID # + <% mt('Account holder') |h %>
+ <% mt("Driver's license or state ID #") |h %>
State<% include('/elements/select-state.html', + <% mt('State') |h %><& /elements/select-state.html, 'disable_empty' => 0, - 'empty_label' => '(choose)', + 'empty_label' => emt('(choose)'), 'state' => $stateid_state, 'country' => $cust_main->country, 'prefix' => 'stateid_', - ) - %> + &>
- Remember this information + <% mt('Remember this informatio') |h %>
- Add to current batch + <% mt('Add to current batch') |h %>
payby ne 'DCRD' ) || ( $payby eq 'CHEK' && $cust_main->payby eq 'CHEK' ) ) ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> - Charge future payments to this <% $type{$payby} %> automatically + <% mt("Charge future payments to this [_1] automatically",$type{$payby}) |h %>

- + -<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Process payment'); -my %type = ( 'CARD' => 'credit card', - 'CHEK' => 'electronic check (ACH)', +my %type = ( 'CARD' => emt('credit card'), + 'CHEK' => emt('electronic check (ACH)'), ); $cgi->param('payby') =~ /^(CARD|CHEK)$/ diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index e17872c06..a4371e6f3 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -1,4 +1,4 @@ -<% header("Package $past{$method}") %> +<% header(emt("Package $past{$method}")) %> @@ -51,10 +51,6 @@ if ($method eq 'expire' || $method eq 'adjourn'){ my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); -#my $otaker = $FS::CurrentUser::CurrentUser->name; -#$otaker = $FS::CurrentUser::CurrentUser->username -# if ($otaker eq "User, Legacy"); - if ($reasonnum == -1) { $reasonnum = { 'typenum' => scalar( $cgi->param('newreasonnumT') ), -- 2.11.0