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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Sep 14 02:53:09 EDT 2006


Author: audreyt
Date: Thu Sep 14 02:53:09 2006
New Revision: 1961

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

Log:
* For some reason, loc('') started spewing out PO metadata.
  This seems to be b0rkeness on the Locale::Maketext layer, but
  for now generalize the undef detection logic in Jifty::I18N
  to recognize that case.

Modified: jifty/trunk/lib/Jifty/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/I18N.pm	(original)
+++ jifty/trunk/lib/Jifty/I18N.pm	Thu Sep 14 02:53:09 2006
@@ -59,7 +59,10 @@
     my $loc_method = sub {
         # Retain compatibility with people using "-e _" etc.
         return \*_ unless @_;
-        return undef unless (defined $_[0]);
+
+        # When $_[0] is undef, return undef.  When it is '', return ''.
+        no warnings 'uninitialized';
+        return $_[0] unless (length $_[0]);
 
         local $@;
         # Force stringification to stop Locale::Maketext from choking on


More information about the Jifty-commit mailing list