summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Plugin/I18N2.pm
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2022-05-09 11:56:15 +0200
committerJannis M. Hoffmann <jannis.hoffmann@rwth-aachen.de>2022-05-09 11:56:15 +0200
commit73503d87d3f9f87a73616bd3f4365906c87ae13e (patch)
tree5efb95a41f132d6a75fdb97401ef42467d9bca86 /lib/JWebmail/Plugin/I18N2.pm
parentde941df4cb8ef4f95563ef818380f870f442f7cd (diff)
fixes for tests and packageing
Diffstat (limited to 'lib/JWebmail/Plugin/I18N2.pm')
-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,