X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FMsgcat.pm;h=b6f36bf95d14ed6a2599eab137e4e2f1efec64dd;hb=156e74067cc8723e187dfd9c5aa7ff956306fe01;hp=2429805158fd4f432e33591d89ded6fc264c84dd;hpb=db303b2cb273b45e03467f36e076b7c1db3bc4a4;p=freeside.git diff --git a/FS/FS/Msgcat.pm b/FS/FS/Msgcat.pm index 242980515..b6f36bf95 100644 --- a/FS/FS/Msgcat.pm +++ b/FS/FS/Msgcat.pm @@ -58,8 +58,10 @@ our %cache; sub _gettext { my $msgcode = shift; + return '' unless defined($msgcode) && length($msgcode) > 0; + my $locale = (@_ && shift) - || $FS::CurrentUser::CurrentUser->option('locale') + || $FS::CurrentUser::CurrentUser->locale || $def_locale; return $cache{$locale}->{$msgcode} if exists $cache{$locale}->{$msgcode}; @@ -86,6 +88,7 @@ sub _gettext { warn "WARNING: auto-inserting message for msgcode $msgcode in locale $locale"; $newmsgcat->insert; } + return $msgcode; } }