[jifty-devel] plugin localization

agostini at univ-metz.fr agostini at univ-metz.fr
Thu Nov 2 16:35:18 EST 2006



Well, if everybody seems ok to let po plugin files in Jifty/Plugin/_name_/po
here my second time patch to load all po files from used plugins in I18N.pm
What do you think about that ?


+    my @import = (
+        'Gettext',Jifty->config->framework('L10N')->{'PoDir'}. '/*.po',
+        'Gettext',Jifty->config->framework('L10N')->{'DefaultPoDir'}. '/*.po'
+        );
+
+    foreach my $plugin (@{Jifty->config->framework('Plugins')}) {
+        push @import, 'Gettext';
+        push @import, Jifty::Util->share_root.'/Plugin/'.(keys %{$plugin})[0].'/po/*.po';
+    };
+
     Locale::Maketext::Lexicon->import(
+        {   '*' => \@import,
             _decode => 1,
             _auto   => 1,
             _style  => 'gettext',


> I will commit my changes on login plugin localization.
> It's very simple, I only change "strings" with _("strings"), or <%
> _("strings") %> on web templates.
> 
> However, I have a problem. Actually, in my debian packages, I put po
> files in Jifty/Plugin/Login/po
> and I copy po files in my TestApp/share/po
> It works but it's not very elegant :(
> 
> Well I suggest that in a first time I commit localized plugin without po
> files. They can be easily create with "jifty po --language=xx"
> 
> In a second time, find a good solution for loading plugin po files.
> 
> Do you think that "Jifty/Plugin/Login/po" is a good place for this
> files ?
> If you are ok, I will change I18N.pm to load path like :
> Jifty->config->framework('L10N')->{'DefaultPoDir'}.'../Plugin/'.
> pluginname .'po/' ( beurk )
> I don't know actually how DefaultPoDir is set and how to load the list
> of plugins.
> 
> Thanks for your comments,
> 
> Yves
> 
> -- 
> ---------------------------------------------------------------
> AGOSTINI Yves             CRI - Université Paul Verlaine - Metz
> agostini at univ-metz.fr     http://www.crium.univ-metz.fr
> tel: 03 87 31 52 63       fax: 03 87 31 53 33
> 
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
> 
> 

-----------------------------------------------------------------
AGOSTINI Yves     CRIUM - Université Paul Verlaine - Metz
agostini at univ-metz.fr    http://www.crium.univ-metz.fr
tel: 03 87 31 52 63          fax: 03 87 31 53 33


More information about the jifty-devel mailing list