From 73503d87d3f9f87a73616bd3f4365906c87ae13e Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Mon, 9 May 2022 11:56:15 +0200 Subject: fixes for tests and packageing --- lib/JWebmail/Plugin/I18N2.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/JWebmail/Plugin/I18N2.pm') 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, -- cgit v1.2.3