From: levinse Date: Sun, 22 May 2011 20:23:21 +0000 (+0000) Subject: internationalization/localization, RT12515 X-Git-Tag: freeside_2_3_0~216 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=7c4a50d23058e764d9bb905df21d9ae6f7f01a4f internationalization/localization, RT12515 --- diff --git a/httemplate/elements/dashboard-toplist.html b/httemplate/elements/dashboard-toplist.html index 6e250b6a3..72f596f4a 100644 --- a/httemplate/elements/dashboard-toplist.html +++ b/httemplate/elements/dashboard-toplist.html @@ -1,6 +1,6 @@ % if ( $conf->exists('dashboard-toplist') ) { - <% include('/elements/table-grid.html') %> + <& /elements/table-grid.html &> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; @@ -24,11 +24,11 @@ <% $cust_main->name %> - <% include('/elements/mcp_lint.html', 'cust_main'=>$cust_main) %> + <& /elements/mcp_lint.html, 'cust_main'=>$cust_main &> - (new ticket) + <% mt('(new ticket)') |h %> @@ -51,7 +51,7 @@ - Unknown customer number <% $custnum %> + <% mt("Unknown customer number [_1]", $custnum) |h %> @@ -75,7 +75,7 @@ <% $line %> - Lint + <% mt('Lint') |h %> % foreach my $priority ( @custom_priorities, '' ) { diff --git a/httemplate/elements/error.html b/httemplate/elements/error.html index f467de2a3..f65785d10 100644 --- a/httemplate/elements/error.html +++ b/httemplate/elements/error.html @@ -1,4 +1,4 @@ % if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') |h %> + <% mt("Error: [_1]", $cgi->param('error')) |h %>

% } diff --git a/httemplate/elements/errorpage.html b/httemplate/elements/errorpage.html index 76a0bf32e..f3794cc13 100644 --- a/httemplate/elements/errorpage.html +++ b/httemplate/elements/errorpage.html @@ -1,4 +1,4 @@ -<% include("/elements/header.html", "Error") %> +<& /elements/header.html, emt("Error") &> % while (@_) { @@ -8,4 +8,3 @@ % $m->flush_buffer(); % $HTML::Mason::Commands::m->abort(); -% #die "shouldn't fall through to here (mason \$m->abort didn't)"; diff --git a/httemplate/elements/input-date-field.html b/httemplate/elements/input-date-field.html index 2a9bc1d53..182efbb93 100644 --- a/httemplate/elements/input-date-field.html +++ b/httemplate/elements/input-date-field.html @@ -6,7 +6,7 @@ % } - + <%once> -my $ticketing_label = '(ticket #, subject, email or fulltext:text)'; +my $ticketing_label = emt('(ticket #, subject, email or fulltext:text)'); <%init> diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index 897c98248..fd2c57eac 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,15 +1,14 @@ -<% include( '/elements/select-table.html', +<& /elements/select-table.html, 'table' => 'agent', 'name_col' => 'agent', 'value' => $agentnum || '', 'agent_virt' => 1, - 'empty_label' => 'all', + 'empty_label' => emt('all'), 'hashref' => { 'disabled' => '' }, 'order_by' => ' ORDER BY agent', 'disable_empty' => $disable_empty, %opt, - ) -%> +&> <%init> my %opt = @_; diff --git a/httemplate/elements/select-part_referral.html b/httemplate/elements/select-part_referral.html index c4b8829c8..114d147ce 100644 --- a/httemplate/elements/select-part_referral.html +++ b/httemplate/elements/select-part_referral.html @@ -1,14 +1,13 @@ -<% include( '/elements/select-table.html', +<& /elements/select-table.html, 'table' => 'part_referral', 'name_col' => 'referral', 'value' => $refnum, - 'empty_label' => 'Select advertising source', + 'empty_label' => emt('Select advertising source'), 'hashref' => { 'disabled' => '' }, 'extra_sql' => ' AND '. FS::part_referral->acl_agentnum_sql(1), %opt, - ) -%> +&> <%init> my %opt = @_; diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html index 417c30fda..d63c49219 100644 --- a/httemplate/elements/select-terms.html +++ b/httemplate/elements/select-terms.html @@ -26,13 +26,13 @@ my $conf = new FS::Conf; my $empty_label = $opt{'empty_label'} - || 'Default ('. - ($conf->config('invoice_default_terms') || 'Payable upon receipt'). + || emt('Default').' ('. + ($conf->config('invoice_default_terms') || emt('Payable upon receipt')). ')'; my $empty_value = $opt{'empty_value'} || ''; -my @terms = ( 'Payable upon receipt', +my @terms = ( emt('Payable upon receipt'), ( map "Net $_", 0, 3, 9, 10, 15, 20, 30, 45, 60, 90 ), ); diff --git a/httemplate/elements/tr-input-money.html b/httemplate/elements/tr-input-money.html index 88014192d..f5749ed08 100644 --- a/httemplate/elements/tr-input-money.html +++ b/httemplate/elements/tr-input-money.html @@ -1,9 +1,8 @@ -<% include('tr-input-text.html', @_, +<& tr-input-text.html, @_, 'type' => 'text', 'prefix' => $money_char, 'size' => 8, - ) -%> +&> <%once> my $conf = new FS::Conf; diff --git a/httemplate/elements/tr-search-cust_main.html b/httemplate/elements/tr-search-cust_main.html index 9df91a18f..031df7c3d 100644 --- a/httemplate/elements/tr-search-cust_main.html +++ b/httemplate/elements/tr-search-cust_main.html @@ -1,6 +1,6 @@ -<% include('tr-td-label.html', @_ ) %> +<& tr-td-label.html, @_ &> - <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><% include('search-cust_main.html', @_ ) %> + <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><& search-cust_main.html, @_ &> diff --git a/httemplate/elements/tr-select-from_to.html b/httemplate/elements/tr-select-from_to.html index 083243d40..100381234 100644 --- a/httemplate/elements/tr-select-from_to.html +++ b/httemplate/elements/tr-select-from_to.html @@ -1,52 +1,45 @@ -% -% -% #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -% my ($curmon,$curyear) = (localtime(time))[4,5]; -% -% #find first month -% my $syear = 1899+$curyear; -% my $smonth = $curmon+1; -% -% #want 12 month by default, not 13 -% $smonth++; -% if ( $smonth > 12 ) { $smonth-=12; $syear++ } -% -% #find last month -% my $eyear = 1900+$curyear; -% my $emonth = $curmon+1; -% -% my %hash = ( -% 'show_month_abbr' => 1, -% 'start_year' => '1999', -% 'end_year' => '2012', #haha, well... -% @_, -% ); -% -% - - - From: + <% mt('From: ') |h %> - <% include('/elements/select-month_year.html', + <& /elements/select-month_year.html, 'prefix' => 'start', 'selected_mon' => $smonth, 'selected_year' => $syear, %hash, - ) - %> + &> - To: + <% mt('To: ') |h %> - <% include('/elements/select-month_year.html', + <& /elements/select-month_year.html, 'prefix' => 'end', 'selected_mon' => $emonth, 'selected_year' => $eyear, %hash, - ) - %> + &> +<%init> + my ($curmon,$curyear) = (localtime(time))[4,5]; + + #find first month + my $syear = 1899+$curyear; + my $smonth = $curmon+1; + + #want 12 month by default, not 13 + $smonth++; + if ( $smonth > 12 ) { $smonth-=12; $syear++ } + + #find last month + my $eyear = 1900+$curyear; + my $emonth = $curmon+1; + + my %hash = ( + 'show_month_abbr' => 1, + 'start_year' => '1999', + 'end_year' => '2012', #haha, well... + @_, + ); + diff --git a/httemplate/elements/tr-select-svc_acct-domain.html b/httemplate/elements/tr-select-svc_acct-domain.html index 9d1a4b678..94196ad48 100644 --- a/httemplate/elements/tr-select-svc_acct-domain.html +++ b/httemplate/elements/tr-select-svc_acct-domain.html @@ -3,14 +3,13 @@ % } else { - <% $opt{'label'} || 'Domain' %> + <% $opt{'label'} || emt('Domain') %> - <% include('/elements/select-svc_acct-domain.html', + <& /elements/select-svc_acct-domain.html, 'curr_value' => $domsvc, 'part_svc' => $part_svc, 'cust_pkg' => $cust_pkg, - ) - %> + &> % }