summaryrefslogtreecommitdiff
path: root/lib/JWebmail/I18N.pm
blob: 190f4be853077fbe4055d395a51f7ea6d7743a78 (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
47
48
package JWebmail::I18N;

use v5.22;
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 { return (); }

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::L10N - Base class for internationalization

=cut