internationalization/localization, RT12515
authorlevinse <levinse>
Sun, 22 May 2011 20:23:21 +0000 (20:23 +0000)
committerlevinse <levinse>
Sun, 22 May 2011 20:23:21 +0000 (20:23 +0000)
13 files changed:
httemplate/elements/dashboard-toplist.html
httemplate/elements/error.html
httemplate/elements/errorpage.html
httemplate/elements/input-date-field.html
httemplate/elements/searchbar-cust_main.html
httemplate/elements/searchbar-ticket.html
httemplate/elements/select-agent.html
httemplate/elements/select-part_referral.html
httemplate/elements/select-terms.html
httemplate/elements/tr-input-money.html
httemplate/elements/tr-search-cust_main.html
httemplate/elements/tr-select-from_to.html
httemplate/elements/tr-select-svc_acct-domain.html

index 6e250b6..72f596f 100644 (file)
@@ -1,6 +1,6 @@
 % if ( $conf->exists('dashboard-toplist') ) {
 
-  <% include('/elements/table-grid.html') %>
+  <& /elements/table-grid.html &>
 
 % my $bgcolor1 = '#eeeeee';
 %     my $bgcolor2 = '#ffffff';
            <A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->name %></A>
          </TD>
           <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-            <% include('/elements/mcp_lint.html', 'cust_main'=>$cust_main) %>
+            <& /elements/mcp_lint.html, 'cust_main'=>$cust_main &>
           </TD>
          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="right">
            <FONT SIZE="-1">
-            <A HREF="<% FS::TicketSystem->href_new_ticket($cust_main) %>">(new ticket)</A>
+            <A HREF="<% FS::TicketSystem->href_new_ticket($cust_main) %>"><% mt('(new ticket)') |h %></A>
             </FONT>
          </TD>
 
@@ -51,7 +51,7 @@
 
         <TR>
           <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-           Unknown customer number <% $custnum %>
+           <% mt("Unknown customer number [_1]", $custnum) |h %> 
          </TD>
         </TR>
 
@@ -75,7 +75,7 @@
 
       <TR>
         <TH CLASS="grid" BGCOLOR="#cccccc"><% $line %></TH>
-       <TH CLASS="grid" BGCOLOR="#cccccc">Lint</TH>
+       <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Lint') |h %></TH>
        <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
 %       foreach my $priority ( @custom_priorities, '' ) {
           <TH CLASS="grid" BGCOLOR="#cccccc">
index f467de2..f65785d 100644 (file)
@@ -1,4 +1,4 @@
 % if ( $cgi->param('error') ) { 
-  <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') |h %></FONT>
+  <FONT SIZE="+1" COLOR="#ff0000"><% mt("Error: [_1]", $cgi->param('error')) |h %></FONT>
   <BR><BR>
 % } 
index 76a0bf3..f3794cc 100644 (file)
@@ -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)";
index 2a9bc1d..182efbb 100644 (file)
@@ -6,7 +6,7 @@
 % }
 
 <INPUT TYPE="text" NAME="<% $name %>" ID="<% $name %>_text" VALUE="<% $value %>">
-<IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name  %>_button" STYLE="cursor: pointer" TITLE="Select date">
+<IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $name  %>_button" STYLE="cursor: pointer" TITLE="<% mt('Select date') |h %>">
 
 <SCRIPT TYPE="text/javascript">
   Calendar.setup({
index e910681..5d79aaa 100644 (file)
@@ -2,8 +2,8 @@
 
   <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
     <INPUT NAME="search_cust" TYPE="text" VALUE="<% $cust_label |n %>" STYLE="width:<%$width%>" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" CLASS="fstext"><BR>
-    <A HREF="<%$fsurl%>search/report_cust_main.html" CLASS="fslink" STYLE="font-size: 11px">Advanced</A>
-    <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
+    <A HREF="<%$fsurl%>search/report_cust_main.html" CLASS="fslink" STYLE="font-size: 11px"><% mt('Advanced') |h %></A>
+    <INPUT TYPE="submit" VALUE="<% mt('Search customers') |h %>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
   </FORM>
   <% $menu_position eq 'left' ? '<BR>' : '' %>
 
@@ -33,6 +33,8 @@ if ( $conf->exists('address1-search') ) {
 }
 $cust_label .= ' or contact phone)';
 
+$cust_label = emt($cust_label);
+
 my $width = $menu_position eq 'left' ? '190px' : $cust_width.'px';
 
 </%init>
index 0907a89..774ca98 100644 (file)
@@ -2,8 +2,8 @@
 
   <FORM ACTION="<% FS::TicketSystem->baseurl %>index.html" METHOD="GET" STYLE="margin:0">
     <INPUT NAME="q" TYPE="text" VALUE="<% $ticketing_label |n %>" STYLE="width:<% $width %>" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" CLASS="fstext"><BR>
-    <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" CLASS="fslink" STYLE="font-size:11px">Advanced</A>
-    <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
+    <A HREF="<% FS::TicketSystem->baseurl %>Search/Build.html" CLASS="fslink" STYLE="font-size:11px"><% mt('Advanced') |h %></A>
+    <INPUT TYPE="submit" VALUE="<% mt('Search tickets') |h %>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
   </FORM>
   <% $menu_position eq 'left' ? '<BR>' : '' %>
 
@@ -19,7 +19,7 @@
 </SCRIPT>
 <%once>
 
-my $ticketing_label = '(ticket #, subject, email or fulltext:text)';
+my $ticketing_label = emt('(ticket #, subject, email or fulltext:text)');
 
 </%once>
 <%init>
index 897c982..fd2c57e 100644 (file)
@@ -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 = @_;
index c4b8829..114d147 100644 (file)
@@ -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 = @_;
index 417c30f..d63c492 100644 (file)
@@ -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 ),
             );
 
index 8801419..f5749ed 100644 (file)
@@ -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;
index 9df91a1..031df7c 100644 (file)
@@ -1,6 +1,6 @@
-<% include('tr-td-label.html', @_ ) %>
+<& tr-td-label.html, @_  &>
 
-  <TD <% $colspan %> <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><% include('search-cust_main.html', @_ ) %></TD>
+  <TD <% $colspan %> <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><& search-cust_main.html, @_  &></TD>
 
 </TR>
 
index 083243d..1003812 100644 (file)
@@ -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...
-%     @_,
-%  );
-%
-%
-
-
 <TR>
-  <TD ALIGN="right">From: </TD>
+  <TD ALIGN="right"><% mt('From: ') |h %></TD>
   <TD>
-    <% include('/elements/select-month_year.html',
+    <& /elements/select-month_year.html,
                   'prefix'        => 'start',
                   'selected_mon'  => $smonth,
                   'selected_year' => $syear,
                   %hash,
-               )
-    %>
+    &>
   </TD>
 </TR>
 
 <TR>
-  <TD ALIGN="right">To: </TD>
+  <TD ALIGN="right"><% mt('To: ') |h %></TD>
   <TD>
-    <% include('/elements/select-month_year.html',
+    <& /elements/select-month_year.html,
                   'prefix'        => 'end',
                   'selected_mon'  => $emonth,
                   'selected_year' => $eyear,
                   %hash,
-               )
-    %>
+    &>
   </TD>
 </TR>
+<%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...
+     @_,
+  );
+</%init>
index 9d1a4b6..94196ad 100644 (file)
@@ -3,14 +3,13 @@
 % } else { 
 
   <TR>
-    <TD ALIGN="right"><% $opt{'label'} || 'Domain' %></TD>
+    <TD ALIGN="right"><% $opt{'label'} || emt('Domain') %></TD>
     <TD>
-      <% include('/elements/select-svc_acct-domain.html',
+      <& /elements/select-svc_acct-domain.html,
                    'curr_value' => $domsvc,
                    'part_svc'   => $part_svc,
                    'cust_pkg'   => $cust_pkg,
-                )
-      %>
+      &>
     </TD>
   </TR>
 % }