[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-1012-g0519c68
Alex Vandiver
alexmv at bestpractical.com
Wed Dec 22 20:26:03 EST 2010
The branch, 3.9-trunk has been updated
via 0519c68556daf5c233eff88d9113fd6c9880bbbc (commit)
from ca47b7bd7f669143034fb2d50dd89993721cecff (commit)
Summary of changes:
share/html/Widgets/FinalizeWidgetArguments | 7 ++++---
t/i18n/caching.t | 5 +----
2 files changed, 5 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit 0519c68556daf5c233eff88d9113fd6c9880bbbc
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Dec 22 20:22:38 2010 -0500
Don't localize values in a global hashref
The ValuesLabel hashref passed into a widget is often pulled straight
from the global %RT::Config::META hash; hence localizing it localizes
it for all future non-English requests. Hence, we instead construct
our own hashref to localize into.
diff --git a/share/html/Widgets/FinalizeWidgetArguments b/share/html/Widgets/FinalizeWidgetArguments
index 45afd9d..df4a847 100644
--- a/share/html/Widgets/FinalizeWidgetArguments
+++ b/share/html/Widgets/FinalizeWidgetArguments
@@ -52,9 +52,10 @@
$args{'Description'} = loc( $args{'Description'} ) if $args{'Description'};
$args{'Hints'} = loc( $args{'Hints'} ) if $args{'Hints'};
if ( $args{'ValuesLabel'} ) {
- while (my ($k, $v) = each %{ $args{'ValuesLabel'} } ) {
- $args{'ValuesLabel'}->{$k} = loc( $args{'ValuesLabel'}->{$k} );
- }
+ my %labels;
+ $labels{$_} = loc( $args{'ValuesLabel'}->{$_} )
+ for keys %{$args{'ValuesLabel'}};
+ $args{'ValuesLabel'} = \%labels;
}
return \%args;
</%init>
diff --git a/t/i18n/caching.t b/t/i18n/caching.t
index 3ea80da..024ef5b 100644
--- a/t/i18n/caching.t
+++ b/t/i18n/caching.t
@@ -28,9 +28,6 @@ $m->get_ok( "/NoAuth/Logout.html" ); # ->logout fails because it's translated
$m->login( root => "password" );
$m->get_ok('/Prefs/Other.html');
-{
- local $TODO = "Per-process caching bug";
- $m->content_lacks('Commentaires','Lacks translated french');
-}
+$m->content_lacks('Commentaires','Lacks translated french');
undef $m;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list