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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Apr 13 04:02:53 EDT 2006


Author: autrijus
Date: Thu Apr 13 04:02:52 2006
New Revision: 859

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

Log:
* Jifty::I18N: allow hard-coding of application language using
  the framework.L10N.Lang config.

Modified: jifty/trunk/lib/Jifty/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/I18N.pm	(original)
+++ jifty/trunk/lib/Jifty/I18N.pm	Thu Apr 13 04:02:52 2006
@@ -49,8 +49,16 @@
 
     $self->init;
 
-    my $lh         = eval { $class->get_handle };
-    my $loc_method = sub  { return undef unless (defined $_[0]); $lh->maketext(@_); };
+    # Allow hard-coded languages in the config file
+    my $lang = Jifty->config->framework('L10N')->{'Lang'};
+    $lang = [defined $lang ? $lang : ()] unless ref($lang) eq 'ARRAY';
+
+    my $lh         = $class->get_handle(@$lang);
+    my $loc_method = sub {
+        return undef unless (defined $_[0]);
+        $lh->maketext(@_);
+    };
+
     {
         no strict 'refs';
         no warnings 'redefine';


More information about the Jifty-commit mailing list