Hi Stefan,

Thank you for answer. According source code 
<https://github.com/sharifulin/mojolicious-plugin-i18n/blob/master/lib/Mojolicious/Plugin/I18N.pm#L16>
 
MyApp::I18N must be defined when I register the plugin:

$self->plugin('I18N');

I (and not only me <https://rt.cpan.org/Public/Bug/Display.html?id=104650>) 
think that the plugin doesn't work in current Mojolicious version - tested 
it at 6.55 and 6.66. I'm trying to understand the reason and it will be 
great if you will help me.
 
For example, when I have 
%=l 'about_service'
at my template and localization module looks like

package MyApp::I18N::en;
use Mojo::Base 'MyApp::I18N';
require Exporter;
our @ISA = qw(Exporter);
our %Lexicon = (
    about_service => 'About app',
);
1;

at rendered template I still see *'about_service'* text instead of 

*'About app'*I also tried to specify the url, e.g. /en. At log I see debug 
message

[Tue Jun 21 11:02:41 2016] [debug] Found language en in URL /en
[Tue Jun 21 11:02:41 2016] [debug] GET "/"
[Tue Jun 21 11:02:41 2016] [debug] Routing to a callback
[Tue Jun 21 11:02:41 2016] [debug] Rendering cached template "index.html.ep"
[Tue Jun 21 11:02:41 2016] [debug] Rendering cached template 
"layouts/default.html.ep"
[Tue Jun 21 11:02:41 2016] [debug] 200 OK (0.007188s, 139.121/s)

But localize subroutine still doesn't work.

What could be the problem?


понедельник, 20 июня 2016 г., 21:43:25 UTC+3 пользователь Stefan Adams 
написал:
>
>
> On Fri, Jun 17, 2016 at 3:48 AM, Pavel Serikov <[email protected] 
> <javascript:>> wrote:
>
>>    package MyApp::I18N::ru;
>>    use Mojo::Base 'MyApp::I18N';
>
>
> Can't locate MyApp/I18N.pm in @INC (you may need to install the 
>> MyApp::I18N module)
>
>
> You are subclassing MyApp::I18N into MyApp::I18N::ru, but I do not see a 
> package MyApp::I18N defined in your code.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to