[Jifty-commit] r777 - in jifty/trunk: lib/Jifty lib/Jifty/Script

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Mar 31 03:26:54 EST 2006


Author: jesse
Date: Fri Mar 31 03:26:52 2006
New Revision: 777

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Everything.pm
   jifty/trunk/lib/Jifty/I18N.pm
   jifty/trunk/lib/Jifty/Script/App.pm

Log:
 r10649 at hualien:  jesse | 2006-03-31 13:55:23 +0900
 * First real pass at I18N support


Modified: jifty/trunk/lib/Jifty/Everything.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Everything.pm	(original)
+++ jifty/trunk/lib/Jifty/Everything.pm	Fri Mar 31 03:26:52 2006
@@ -10,6 +10,7 @@
 =cut
 
 use Jifty ();
+use Jifty::I18N; # exporter
 use Jifty::Dispatcher ();
 use Jifty::Object ();
 use Jifty::Config ();

Modified: jifty/trunk/lib/Jifty/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/I18N.pm	(original)
+++ jifty/trunk/lib/Jifty/I18N.pm	Fri Mar 31 03:26:52 2006
@@ -9,23 +9,22 @@
 
 =head1 METHODS
 
-=head2 loc
+=head2 C<loc> /  C<_>
 
 This module exports the C<loc> method, which it inherits from
-L<Locale::Maketext::Simple>.
+L<Locale::Maketext::Simple>. Jifty aliases this method to C<_()> for 
+your convenience.
 
 =cut
 
-use base 'Exporter';
 
-our @EXPORT = 'loc';
-
-require Locale::Maketext::Simple;
-Locale::Maketext::Simple->import(
-    Subclass => '',
-    Path     => substr(__FILE__, 0, -3),
-    Style    => 'gettext',
-    Encoding => 'locale',
+use Locale::Maketext::Simple (
+    Path        => [Jifty->config->framework('PoDir'),  Jifty->config->framework('DefaultPoDir')],
+    Style       => 'gettext',
+    Decode      => 1,
 );
 
+# Allow _() everywhere to loc
+*_ = \&loc;
+
 1;

Modified: jifty/trunk/lib/Jifty/Script/App.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/App.pm	(original)
+++ jifty/trunk/lib/Jifty/Script/App.pm	Fri Mar 31 03:26:52 2006
@@ -123,9 +123,10 @@
         var
         var/sessions
         var/mason
-        web
-        web/templates
-        web/static
+        share/po
+        share/web
+        share/web/templates
+        share/web/static
         lib/__APP__/Model
         lib/__APP__/Action
         t


More information about the Jifty-commit mailing list