[freeside-commits] branch FREESIDE_3_BRANCH updated. bcf19c4221daf8fbc245789408fb09528005e876
Jeremy Davis
jeremyd at 420.am
Fri Feb 7 10:50:50 PST 2014
The branch, FREESIDE_3_BRANCH has been updated
via bcf19c4221daf8fbc245789408fb09528005e876 (commit)
from 9aaccf56a9cb4367a72450911f26cd9b324c3717 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bcf19c4221daf8fbc245789408fb09528005e876
Author: Mark Wells <mark at freeside.biz>
Date: Wed Jan 29 18:34:27 2014 -0800
fix localization cache, #27276
diff --git a/FS/FS/L10N/DBI.pm b/FS/FS/L10N/DBI.pm
index db387db..dc92317 100644
--- 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;
-our %Lexicon = ();
+sub lexicon {
+ my $lh = shift;
+ my $class = ref($lh) || $lh;
+ no strict 'refs';
+ \%{ $class . '::Lexicon' };
+}
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) };
-----------------------------------------------------------------------
Summary of changes:
FS/FS/L10N/DBI.pm | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list