[interchange-cvs] interchange - heins modified lib/Vend/Config.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Mar 8 11:17:55 EST 2007


User:      heins
Date:      2007-03-08 16:17:55 GMT
Modified:  lib/Vend Config.pm
Log:
* Make standard Locale dispatch routine call setlocale if an mv_currency
  is defined as persistent.

Revision  Changes    Path
2.214     +23 -19    interchange/lib/Vend/Config.pm


rev 2.214, prev_rev 2.213
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.213
retrieving revision 2.214
diff -u -r2.213 -r2.214
--- Config.pm	24 Feb 2007 05:48:26 -0000	2.213
+++ Config.pm	8 Mar 2007 16:17:55 -0000	2.214
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.213 2007/02/24 05:48:26 jon Exp $
+# $Id: Config.pm,v 2.214 2007/03/08 16:17:55 mheins Exp $
 #
 # Copyright (C) 2002-2007 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -54,7 +54,7 @@
 use Vend::Data;
 use Vend::Cron;
 
-$VERSION = substr(q$Revision: 2.213 $, 10);
+$VERSION = substr(q$Revision: 2.214 $, 10);
 
 my %CDname;
 my %CPname;
@@ -3177,25 +3177,29 @@
 		}
 	},
 
-	Locale => sub {
+    Locale => sub {
 #::logDebug("Doing Locale dispatch...");
-		my $locale = $::Scratch->{mv_locale}
-			or return;
-
-		if(! $::Scratch->{mv_language}) {
-			$Global::Variable->{LANG}
-					= $::Variable->{LANG}
-					= $::Scratch->{mv_language}
-					= $locale;
-		}
+        my $locale = $::Scratch->{mv_locale};
+        my $curr = $::Scratch->{mv_currency};
+        $locale || $curr    or return;
+
+        if($locale and ! $::Scratch->{mv_language}) {
+            $Global::Variable->{LANG}
+                    = $::Variable->{LANG}
+                    = $::Scratch->{mv_language}
+                    = $locale;
+        }
+
+        if($locale) {
+            return unless defined $Vend::Cfg->{Locale_repository}{$locale};
+        }
+        elsif($curr) {
+            return unless defined $Vend::Cfg->{Locale_repository}{$curr};
+        }
+#::logDebug("running locale dispatch, locale=$locale, currency=$curr");
 
-		return unless defined $Vend::Cfg->{Locale_repository}{$locale};
-
-		Vend::Util::setlocale(  $locale,
-								($::Scratch->{mv_currency} || undef),
-								{ persist => 1 }
-							);
-	},
+        Vend::Util::setlocale( $locale, $curr, { persist => 1 } );
+    },
 
 	DiscountSpaces => sub {
 #::logDebug("Doing DiscountSpaces dispatch...");








More information about the interchange-cvs mailing list