Hi All I am trying to use Dancer2::Plugin::Locale::Wolowitz, but it does not seem to pick the config info at all. Here is my config.yml plugins: Locale::Wolowitz: lang_session: "es" locale_path_directory: "locale/default" I presume this looks for a directory under the project path of locale/default. If I try and use loc() I get an error saying the i18n directory cannot be found. Even if I create the i18n directory under the project root, it still does not work. I even dumped plugin_settings() from within loc() and it returns empty. Any ideas? Zahir Lalani Head of Development & Architecture [cid:96F784CA-E917-4CC1-A9A9-96CBDA2AF2BC] 2 Tabernacle Street, London, EC2A 4LU m: +44 (0)7956 455168 t: +44 (0)203 142 3619 e: zahirlalani@oliver-marketing.com<mailto:zahirlalani@oliver-marketing.com> w: www.oliver-marketing.com<http://www.oliver-marketing.com/>
On 08/15/2016 02:48 PM, Zahir Lalani wrote:
Hi All
I am trying to use Dancer2::Plugin::Locale::Wolowitz, but it does not seem to pick the config info at all.
Here is my config.yml
plugins:
Locale::Wolowitz:
lang_session: "es"
locale_path_directory: "locale/default"
I presume this looks for a directory under the project path of locale/default. If I try and use loc() I get an error saying the i18n directory cannot be found. Even if I create the i18n directory under the project root, it still does not work. I even dumped plugin_settings() from within loc() and it returns empty.
Any ideas?
Did you try to use an absolute path in your config? Maybe the plugin looks in the wrong directory ... Regards Racke
*Zahir Lalani Head of Development & Architecture*
cid:96F784CA-E917-4CC1-A9A9-96CBDA2AF2BC
2 Tabernacle Street,
London, EC2A 4LU
m: +44 (0)7956 455168
t: +44 (0)203 142 3619
e: _zahirlalani@oliver-marketing.com <mailto:zahirlalani@oliver-marketing.com>_
w: www.oliver-marketing.com <http://www.oliver-marketing.com/>
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Ecommerce and Linux consulting + Perl and web application programming.
-----Original Message----- From: dancer-users [mailto:dancer-users-bounces@dancer.pm] On Behalf Of Stefan Hornburg (Racke) Sent: 15 August 2016 13:52 To: dancer-users@dancer.pm Subject: Re: [dancer-users] Wolowitz
On 08/15/2016 02:48 PM, Zahir Lalani wrote:
Hi All
I am trying to use Dancer2::Plugin::Locale::Wolowitz, but it does not seem to pick the config info at all.
Here is my config.yml
plugins:
Locale::Wolowitz:
lang_session: "es"
locale_path_directory: "locale/default"
I presume this looks for a directory under the project path of locale/default. If I try and use loc() I get an error saying the i18n directory cannot be found. Even if I create the i18n directory under the project root, it still does not work. I even dumped plugin_settings() from within loc() and it returns empty.
Any ideas?
Did you try to use an absolute path in your config?
Maybe the plugin looks in the wrong directory ...
Regards Racke
Hi Racke No good - it still tries to look for "i18n" - it seems its not picking up the config at all and initialises with defaults only? In the error output, here is the dump of what the config looks like: plugins => { Ajax => { content_type => 'application/json' }, Database => { connection_check_threshold => 20, database => 'OMG', dbi_params => { AutoCommit => 1, RaiseError => 1 }, driver => 'Pg', host => '127.0.0.1', log_queries => 1, password => xx, port => 5432, username => xx }, Locale::Wolowitz => { lang_session => 'es', locale_path_directory => '/home/dev/omg/locale/default' } }, Z
On 08/15/2016 03:01 PM, Zahir Lalani wrote:
-----Original Message----- From: dancer-users [mailto:dancer-users-bounces@dancer.pm] On Behalf Of Stefan Hornburg (Racke) Sent: 15 August 2016 13:52 To: dancer-users@dancer.pm Subject: Re: [dancer-users] Wolowitz
On 08/15/2016 02:48 PM, Zahir Lalani wrote:
Hi All
I am trying to use Dancer2::Plugin::Locale::Wolowitz, but it does not seem to pick the config info at all.
Here is my config.yml
plugins:
Locale::Wolowitz:
lang_session: "es"
locale_path_directory: "locale/default"
I presume this looks for a directory under the project path of locale/default. If I try and use loc() I get an error saying the i18n directory cannot be found. Even if I create the i18n directory under the project root, it still does not work. I even dumped plugin_settings() from within loc() and it returns empty.
Any ideas?
Did you try to use an absolute path in your config?
Maybe the plugin looks in the wrong directory ...
Regards Racke
Hi Racke
No good - it still tries to look for "i18n" - it seems its not picking up the config at all and initialises with defaults only?
In the error output, here is the dump of what the config looks like:
plugins => { Ajax => { content_type => 'application/json' }, Database => { connection_check_threshold => 20, database => 'OMG', dbi_params => { AutoCommit => 1, RaiseError => 1 }, driver => 'Pg', host => '127.0.0.1', log_queries => 1, password => xx, port => 5432, username => xx }, Locale::Wolowitz => { lang_session => 'es', locale_path_directory => '/home/dev/omg/locale/default' } },
Z
Yeah, in the source code of this plugin we have: my $conf = $dsl->{app}{config}{plugins}{'Locale::Wolowitz'}; This look very suspicious (going through hashrefs instead of using methods) and is most likely the cause of your problem. I suggest to contact the author and ask him to fix this mistake. Regards Racke
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Ecommerce and Linux consulting + Perl and web application programming.
-----Original Message----- From: dancer-users [mailto:dancer-users-bounces@dancer.pm] On Behalf Of Stefan Hornburg (Racke) Sent: 15 August 2016 14:12 To: dancer-users@dancer.pm Subject: Re: [dancer-users] Wolowitz
On 08/15/2016 03:01 PM, Zahir Lalani wrote:
-----Original Message----- From: dancer-users [mailto:dancer-users-bounces@dancer.pm] On
Behalf
Of Stefan Hornburg (Racke) Sent: 15 August 2016 13:52 To: dancer-users@dancer.pm Subject: Re: [dancer-users] Wolowitz
On 08/15/2016 02:48 PM, Zahir Lalani wrote:
Hi All
I am trying to use Dancer2::Plugin::Locale::Wolowitz, but it does not seem to pick the config info at all.
Here is my config.yml
plugins:
Locale::Wolowitz:
lang_session: "es"
locale_path_directory: "locale/default"
I presume this looks for a directory under the project path of locale/default. If I try and use loc() I get an error saying the i18n directory cannot be found. Even if I create the i18n directory under the project root, it still does not work. I even dumped plugin_settings() from within loc() and it returns empty.
Any ideas?
Did you try to use an absolute path in your config?
Maybe the plugin looks in the wrong directory ...
Regards Racke
Hi Racke
No good - it still tries to look for "i18n" - it seems its not picking up the config at all and initialises with defaults only?
In the error output, here is the dump of what the config looks like:
plugins => { Ajax => { content_type => 'application/json' }, Database => { connection_check_threshold => 20, database => 'OMG', dbi_params => { AutoCommit => 1, RaiseError => 1 }, driver => 'Pg', host => '127.0.0.1', log_queries => 1, password => xx, port => 5432, username => xx }, Locale::Wolowitz => { lang_session => 'es', locale_path_directory => '/home/dev/omg/locale/default' } },
Z
Yeah, in the source code of this plugin we have:
my $conf = $dsl->{app}{config}{plugins}{'Locale::Wolowitz'};
This look very suspicious (going through hashrefs instead of using methods) and is most likely the cause of your problem.
I suggest to contact the author and ask him to fix this mistake.
Regards Racke
Oh dear Thx Racke
participants (2)
-
Stefan Hornburg (Racke) -
Zahir Lalani