diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-02-09 22:27:03 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-02-09 22:27:03 -0800 |
commit | f7329b766b496393064a4dd4df2515cbfbb00827 (patch) | |
tree | 0ccdf033b012318ea7adba6307c4a0b461fb826f /FS/FS/Maketext.pm | |
parent | 53c4589b2950b3ed85bcacfb707430c60cd1021e (diff) |
optimize Reports->Customers->List Customers, RT#20173
Diffstat (limited to 'FS/FS/Maketext.pm')
-rw-r--r-- | FS/FS/Maketext.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/FS/FS/Maketext.pm b/FS/FS/Maketext.pm index c90e57303..b4a9b81c7 100644 --- a/FS/FS/Maketext.pm +++ b/FS/FS/Maketext.pm @@ -1,6 +1,6 @@ package FS::Maketext; - use base qw( Exporter ); + use FS::CurrentUser; use FS::Conf; use FS::L10N; @@ -10,6 +10,13 @@ our @EXPORT_OK = qw( mt emt js_mt ); our $lh; +our $locale; +#ask FS::UID to run this stuff for us later +FS::UID->install_callback( sub { + my $conf = new FS::Conf; + $locale = $conf->config('locale'); +}); + sub mt { return '' if $_[0] eq ''; $lh ||= lh(); @@ -32,8 +39,8 @@ sub js_mt { } sub lh { - my $locale = $FS::CurrentUser::CurrentUser->option('locale') - || FS::Conf->new->config('locale') + my $locale = $FS::CurrentUser::CurrentUser->locale + || $locale || 'en_US'; $locale =~ s/_/-/g; FS::L10N->get_handle($locale) || die "Unknown locale $locale"; |