[Jifty-commit] r1912 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Aug 31 19:25:56 EDT 2006


Author: audreyt
Date: Thu Aug 31 19:25:56 2006
New Revision: 1912

Modified:
   jifty/trunk/lib/Jifty/I18N.pm

Log:
* r1907 broke L10N as things localizing to "0" or "" in the
  dictionary was instead treated as errors.  Deal with errors
  properly with "local $@" now.

Modified: jifty/trunk/lib/Jifty/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/I18N.pm	(original)
+++ jifty/trunk/lib/Jifty/I18N.pm	Thu Aug 31 19:25:56 2006
@@ -60,9 +60,15 @@
         # Retain compatibility with people using "-e _" etc.
         return \*_ unless @_;
         return undef unless (defined $_[0]);
-        # Sometimes Locale::Maketext fails to localize a string. Catastropically
-        # In that case just return the input
-        return eval { $lh->maketext(@_)} || join(' ', at _);
+
+        local $@;
+        my $result = eval { $lh->maketext(@_) };
+        if ($@) {
+            # Sometimes Locale::Maketext fails to localize a string and throws
+            # an exception instead.  In that case, we just return the input.
+            return join(' ', @_);
+        }
+        return $result;
     };
 
     {


More information about the Jifty-commit mailing list