summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'lib/JWebmail/Plugin')
-rw-r--r--lib/JWebmail/Plugin/I18N2.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/JWebmail/Plugin/I18N2.pm b/lib/JWebmail/Plugin/I18N2.pm
index 31d6234..0d94f4b 100644
--- a/lib/JWebmail/Plugin/I18N2.pm
+++ b/lib/JWebmail/Plugin/I18N2.pm
@@ -151,8 +151,8 @@ package JWebmail::Plugin::I18N2::Match::Role {
my $key = shift;
my $value = shift;
- if (@_ == 1) { # handles ($) and (\%)
- $_[0]->{$key} ||= $value if ref $_[0] eq 'HASH';
+ if (@_ == 1 && ref $_[0] eq 'HASH') { # handles (\%)
+ $_[0]->{$key} ||= $value;
}
elsif (@_ == 2 && ref $_[1] eq 'HASH') { # handles ($, \%)
$_[1]->{$key} ||= $value;
@@ -189,9 +189,7 @@ sub register {
my $translator = $conf->{translator} || sub { JWebmail::Plugin::I18N2::Maketext->new(@_) };
my $defaultLang = $conf->{default_language} || 'en';
- my $fileLocation = $conf->{directory}
- ? Mojo::File->new($conf->{directory})
- : $app->home->child('lang');
+ my $fileLocation = $conf->{directory}; # ? Mojo::File->new($conf->{directory}) : $app->home->child('lang');
my $t = $translator->(
default_language => $defaultLang,