[jifty-devel] plugin localization
Agostini yves
agostini at univ-metz.fr
Fri Nov 3 03:53:54 EST 2006
Le vendredi 03 novembre 2006 à 02:58 -0500, Jesse Vincent a écrit :
>
>
> On Fri, Nov 03, 2006 at 08:51:56AM +0100, Agostini yves wrote:
> > Le jeudi 02 novembre 2006 à 19:47 -0500, Jesse Vincent a écrit :
> > >
> > >
> > > On Thu, Nov 02, 2006 at 10:35:18PM +0100, agostini at univ-metz.fr wrote:
> > > >
> > > >
> > > > Well, if everybody seems ok to let po plugin files in Jifty/Plugin/_name_/po
> > >
> > > I _think_ we want the podir to defailt to the sharedir/po for the plugin.
> > > (Does that make sense?)
> > Not really :D
> > But I was the first to be unclear
> > I wanted to say that for sources : we have usual
> > plugins/Login/share/po
> > and for install it will be
> > Jifty::Util->share_root.'/Plugin/Login/po'
> > So, I18N will load from Jifty::Util->share_root.'/Plugin/Login/po'
> >
> > Is this ok ?
> >
>
> For most jifty plugins, you should be able to distribute and install
> them separetely from Jifty, so for
>
> Jifty::Plugin::Login,
>
> I'd expect to find po files in:
>
> use File::ShareDir;
> $dir = module_dir('Jifty::Plugin::Login')."/po/";
>
> This lets plugins act more like regular CPAN module, which I think could
> be a very nice thing.
>
ok, thank you for your early morning answer :)
I test this :
foreach my $plugin (@{Jifty->config->framework('Plugins')}) {
push @import, 'Gettext';
push @import, module_dir('Jifty::Plugin::'.(keys
%{$plugin})[0]).'/po/*.po';
};
that works but ....
"Jifty::Plugin::Login is not yet loaded"
well I have to load Jifty::I18N->new(); later in Jifty.pm
I could put Jifty::I18N->new() even later (between
Jifty->plugins(@plugins);
and
Jifty->handler(Jifty::Handler->new());
)
and make this :
foreach my $plugin (Jifty->plugins) {
push @import, 'Gettext';
push @import, module_dir(ref($plugin)).'/po/*.po';
};
The last one seems to me the better.
Which solution do you prefer ?
Take your time, have a good night.
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
More information about the jifty-devel
mailing list