projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c17319b
)
Msgcat.pm: return untranslated strings properly when no translation is found
author
levinse
<levinse>
Tue, 14 Jun 2011 18:53:40 +0000
(18:53 +0000)
committer
levinse
<levinse>
Tue, 14 Jun 2011 18:53:40 +0000
(18:53 +0000)
FS/FS/Msgcat.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Msgcat.pm
b/FS/FS/Msgcat.pm
index
2429805
..
2406e8d
100644
(file)
--- a/
FS/FS/Msgcat.pm
+++ b/
FS/FS/Msgcat.pm
@@
-58,6
+58,8
@@
our %cache;
sub _gettext {
my $msgcode = shift;
sub _gettext {
my $msgcode = shift;
+ return '' unless defined($msgcode) && length($msgcode) > 0;
+
my $locale = (@_ && shift)
|| $FS::CurrentUser::CurrentUser->option('locale')
|| $def_locale;
my $locale = (@_ && shift)
|| $FS::CurrentUser::CurrentUser->option('locale')
|| $def_locale;
@@
-85,6
+87,7
@@
sub _gettext {
});
warn "WARNING: auto-inserting message for msgcode $msgcode in locale $locale";
$newmsgcat->insert;
});
warn "WARNING: auto-inserting message for msgcode $msgcode in locale $locale";
$newmsgcat->insert;
+ return $msgcode; # or maybe this should be below the next bracket?
}
}
}
}