projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c81748
)
fix localization cache, #27276
author
Mark Wells
<mark@freeside.biz>
Thu, 30 Jan 2014 02:14:29 +0000
(18:14 -0800)
committer
Mark Wells
<mark@freeside.biz>
Thu, 30 Jan 2014 02:14:29 +0000
(18:14 -0800)
FS/FS/L10N/DBI.pm
patch
|
blob
|
history
diff --git
a/FS/FS/L10N/DBI.pm
b/FS/FS/L10N/DBI.pm
index
db387db
..
dc92317
100644
(file)
--- a/
FS/FS/L10N/DBI.pm
+++ b/
FS/FS/L10N/DBI.pm
@@
-3,15
+3,22
@@
use base qw(FS::L10N);
use strict;
use FS::Msgcat;
use strict;
use FS::Msgcat;
-our %Lexicon = ();
+sub lexicon {
+ my $lh = shift;
+ my $class = ref($lh) || $lh;
+ no strict 'refs';
+ \%{ $class . '::Lexicon' };
+}
sub maketext {
my($lh, $key, @rest) = @_;
sub maketext {
my($lh, $key, @rest) = @_;
- unless ( exists $Lexicon{$key} ) {
- my $lang = $lh->language_tag;
- $lang =~ s/-(\w*)/_\U$1/;
- $Lexicon{$key} = FS::Msgcat::_gettext( $key, $lang );
+ my $lang = $lh->language_tag;
+ $lang =~ s/-(\w*)/_\U$1/;
+
+ my $lex = $lh->lexicon;
+ unless ( exists $lex->{$key} ) {
+ $lex->{$key} = FS::Msgcat::_gettext( $key, $lang );
}
my $res = eval { $lh->SUPER::maketext($key, @rest) };
}
my $res = eval { $lh->SUPER::maketext($key, @rest) };