fix TeleAPI import (what kind of crack was Christopher smoking that he couldn't fix...
[freeside.git] / FS / FS / Msgcat.pm
index ce0fa78..e1bde8b 100644 (file)
@@ -1,7 +1,7 @@
 package FS::Msgcat;
 
 use strict;
-use vars qw( @ISA @EXPORT_OK $conf $def_locale $debug );
+use vars qw( @ISA @EXPORT_OK $conf $def_locale $debug @translate_auto_insert );
 use Exporter;
 use FS::UID;
 #use FS::Record qw( qsearchs ); # wtf?  won't import...
@@ -17,7 +17,8 @@ FS::UID->install_callback( sub {
   die $@ if $@;
   $conf = new FS::Conf;
   $def_locale = $conf->config('locale') || 'en_US';
-  $debug = $conf->exists('show-msgcat-codes')
+  $debug = $conf->exists('show-msgcat-codes');
+  @translate_auto_insert = $conf->config('translate-auto-insert');
 });
 
 =head1 NAME
@@ -61,7 +62,7 @@ sub _gettext {
   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};
@@ -77,7 +78,6 @@ sub _gettext {
       unless $locale eq 'en_US';
     $cache{$locale}->{$msgcode} = $msgcode;
 
-    my @translate_auto_insert = $conf->config('translate-auto-insert');
     if ( $locale ne 'en_US' && grep { $_ eq $locale } @translate_auto_insert ) {
 
         # :(