File: App.pm

package info (click to toggle)
libmojolicious-plugin-i18n-perl 1.60-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 136 kB
  • sloc: perl: 472; makefile: 2
file content (31 lines) | stat: -r--r--r-- 586 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package App;
use Mojo::Base 'Mojolicious';

has test => 'Test App';

sub startup {
	my $self = shift;
	
	$self->plugin('mail');
	$self->plugin(I18N => {default => 'ru', support_url_langs => [qw(ru en)]});
	
	$self->renderer->paths(['.']);
}

package App::I18N;
use base 'Locale::Maketext';

sub import { warn __PACKAGE__ . ' ' . caller; }

package App::I18N::en;
use Mojo::Base 'App::I18N';

our %Lexicon = (_AUTO => 1, hello2 => 'Hello two');

package App::I18N::ru;
use Mojo::Base 'App::I18N';
use utf8;

our %Lexicon = (hello => 'Привет', hello2 => 'Привет два');

1;