summaryrefslogtreecommitdiff
path: root/lib/JWebmail/I18N.pm
blob: be04da073457e5e0ef8353e14d6ef8983219ec0b (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package JWebmail::I18N;

use v5.24;
use warnings;
use utf8;

use parent 'Locale::Maketext';


sub init {
    my $self = shift;
    $self->SUPER::init(@_);

    $self->fail_with('log_on_failure');
}

sub fallback_languages { qw() }

sub log_on_failure {
    my $self = shift;
    my $prase = shift;
    $self->logger->("missing translation for @{[$self->language_tag]}:'$prase'");
    $self->failure_handler_auto($prase, @_);
}

sub logger {
    my $self = shift;
    if (@_) {
        $self->{_jwm_logger} = $_[0];
        return $self;
    }
    else {
        return $self->{_jwm_logger};
    }
}


1

__END__

=encoding utf-8

=head1 NAME

JWebmail::I18N - Base class for internationalization