[Rt-commit] rt branch, 4.0/group-by-i18n-in-search-chart-page, created. rt-4.0.6-216-gf7586a5

? sunnavy sunnavy at bestpractical.com
Sat Jun 30 04:30:42 EDT 2012


The branch, 4.0/group-by-i18n-in-search-chart-page has been created
        at  f7586a5f9ab2b5531f5aa60e1b4545f6ac3373d5 (commit)

- Log -----------------------------------------------------------------
commit f7586a5f9ab2b5531f5aa60e1b4545f6ac3373d5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jun 21 11:48:40 2012 +0800

    fix the loc of "group by" in search chart page by joining the sperated loc-ed words
    
    e.g. instead of loc('Owner Name'), we join existing loc('Owner') and
    loc('Name'). now left words are qw(Hourly Annually), which we should extract
    to .po files

diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index de40dbd..3e0920f 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -57,22 +57,27 @@ use warnings;
 sub Groupings {
     my $self = shift;
     my %args = (@_);
-    my @fields = map {$_, $_} qw(
-        Status
-        Queue
-    );
-
-    foreach my $type ( qw(Owner Creator LastUpdatedBy Requestor Cc AdminCc Watcher) ) {
-        push @fields, $type.' '.$_, $type.'.'.$_ foreach qw(
-            Name EmailAddress RealName NickName Organization Lang City Country Timezone
-        );
+    my @fields =
+      map { $self->CurrentUser->loc($_), $_ } qw( Status Queue );    # loc_qw
+
+    foreach my $type ( qw(Owner Creator LastUpdatedBy Requestor Cc AdminCc Watcher) ) { # loc_qw
+        for my $field (
+            qw( Name EmailAddress RealName NickName Organization Lang City Country Timezone ) # loc_qw
+          )
+        {    # loc
+            push @fields,
+              $self->CurrentUser->loc($type) . ' '
+              . $self->CurrentUser->loc($field), $type . '.' . $field;
+        }
     }
 
 
-    for my $field (qw(Due Resolved Created LastUpdated Started Starts Told)) {
-        for my $frequency (qw(Hourly Daily Monthly Annually)) {
-            my $item = $field.$frequency;
-            push @fields,  $item,  $item;
+    for my $field (qw(Due Resolved Created LastUpdated Started Starts Told)) { # loc_qw
+        for my $frequency (qw(Hourly Daily Monthly Annually)) { # loc_qw
+            push @fields,
+              $self->CurrentUser->loc($field)
+              . $self->CurrentUser->loc($frequency),
+              $field . $frequency;
         }
     }
 
@@ -93,7 +98,11 @@ sub Groupings {
         }
         $CustomFields->LimitToGlobal;
         while ( my $CustomField = $CustomFields->Next ) {
-            push @fields, "Custom field '". $CustomField->Name ."'", "CF.{". $CustomField->id ."}";
+            push @fields, $self->CurrentUser->loc(
+                "Custom field '[_1]'",
+                $CustomField->Name
+              ),
+              "CF.{" . $CustomField->id . "}";
         }
     }
     return @fields;
diff --git a/share/html/Search/Elements/SelectGroupBy b/share/html/Search/Elements/SelectGroupBy
index 9a6951a..ed67a3b 100644
--- a/share/html/Search/Elements/SelectGroupBy
+++ b/share/html/Search/Elements/SelectGroupBy
@@ -53,7 +53,7 @@ $Query   => ''
 <select id="<% $Name %>" name="<% $Name %>">
 % while (@options) {
 % my ($text, $value) = (shift @options, shift @options);
-<option value="<% $value %>" <% $value eq $Default ? 'selected="selected"' : '' |n%>><% loc($text) %></option>
+<option value="<% $value %>" <% $value eq $Default ? 'selected="selected"' : '' |n%>><% $text %></option>
 % }
 </select>
 <%init>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list