[Rt-commit] r4694 - in rt/branches/3.7-EXPERIMENTAL: . lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Sat Mar 4 23:07:38 EST 2006


Author: ruz
Date: Sat Mar  4 23:07:38 2006
New Revision: 4694

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm

Log:
 r2101 at cubic-pc:  cubic | 2006-03-05 07:14:05 +0300
 * localize config metadata


Modified: rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html	Sat Mar  4 23:07:38 2006
@@ -12,7 +12,7 @@
 % my $meta = RT->Config->Meta( $option );
 <& $meta->{'Widget'},
     Empty        => 1,
-    %{ $meta->{'WidgetArguments'} },
+    %{ $localize_meta->( $meta->{'WidgetArguments'} ) },
     Name         => $option,
     EmptyValue   => scalar RT->Config->Get( $option ),
     CurrentValue => $preferences->{ $option },
@@ -49,6 +49,16 @@
     }
     $UserObj->SetPreferences( $RT::System, $preferences );
 }
+my $localize_meta = sub {
+    my %meta = %{ shift() };
+    $meta{'Description'} = loc( $meta{'Description'} ) if $meta{'Description'};
+    if ( $meta{'ValuesLabel'} ) {
+        while (my ($k, $v) = each %{ $meta{'ValuesLabel'} } ) {
+            $meta{'ValuesLabel'}->{$k} = loc( $meta{'ValuesLabel'}->{$k} );
+        }
+    }
+    return \%meta;
+};
 </%INIT>
 <%ARGS>
 $Update => 0,

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	Sat Mar  4 23:07:38 2006
@@ -51,11 +51,11 @@
 
 our %META = (
     WebDefaultStylesheet => {
-        Section         => 'General',
+        Section         => 'General', #loc
         Overridable     => 1,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
-            Description => 'Interface style',
+            Description => 'Interface style', #loc
             Values      => [qw(3.5-default 3.4-compat)],
             Mutiple     => 0,
             Alternative => 0,
@@ -66,7 +66,7 @@
         Overridable     => 1,
         Widget          => '/Widgets/Form/Integer',
         WidgetArguments => {
-            Description => 'Message boxes width',
+            Description => 'Message boxes width', #loc
         },
     },
     MessageBoxHeight => {
@@ -74,15 +74,15 @@
         Overridable     => 1,
         Widget          => '/Widgets/Form/Integer',
         WidgetArguments => {
-            Description => 'Message boxes height',
+            Description => 'Message boxes height', #loc
         },
     },
     MaxInlineBody => {
-        Section         => 'Tickets view',
+        Section         => 'Tickets view', #loc
         Overridable     => 1,
         Widget          => '/Widgets/Form/Integer',
         WidgetArguments => {
-            Description => 'Max size of message(bytes) that would be inlined into history',
+            Description => 'Max size of message(bytes) that would be inlined into history', #loc
         },
     },
     OldestTransactionsFirst => {
@@ -90,21 +90,21 @@
         Overridable     => 1,
         Widget          => '/Widgets/Form/Boolean',
         WidgetArguments => {
-            Description => 'Show oldest transactions first',
+            Description => 'Show oldest transactions first', #loc
         },
     },
     DateTimeFormat      => {
-        Section         => 'Date and time',
+        Section         => 'Date and time', #loc
         Overridable     => 1,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
-            Description => 'Date and time output format',
+            Description => 'Date and time output format', #loc
             Values      => [qw(DefaultFormat RFC2822 ISO W3CDTF)],
             ValuesLabel => {
-                DefaultFormat => 'Default (Tue Dec 25 21:59:12 1995)',
-                RFC2822       => 'RFC (Tue, 25 Dec 1995 21:59:12 -0300)',
-                ISO           => 'ISO (1995-11-25 21:59:12)',
-                W3CDTF        => 'W3C (1995-11-25T21:59:12Z)',
+                DefaultFormat => 'Default (Tue Dec 25 21:59:12 1995)', #loc
+                RFC2822       => 'RFC (Tue, 25 Dec 1995 21:59:12 -0300)', #loc
+                ISO           => 'ISO (1995-11-25 21:59:12)', #loc
+                W3CDTF        => 'W3C (1995-11-25T21:59:12Z)', #loc
             },
         },
     },


More information about the Rt-commit mailing list