[LON-CAPA-cvs] cvs: loncom /localize lonlocal.pm

bisitz bisitz@source.lon-capa.org
Thu, 05 Feb 2009 10:39:09 -0000


bisitz		Thu Feb  5 10:39:09 2009 EDT

  Modified files:              
    /loncom/localize	lonlocal.pm 
  Log:
  Deactivated new cache functionality for &mt
  which was introduced in revision 1.54
  due to missing/incorrect functionality:
    - Returned empty value instead of translation in some cases
    - Didn't respect user pref language changes
    - Didn't respect course language
  
  
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.54 loncom/localize/lonlocal.pm:1.55
--- loncom/localize/lonlocal.pm:1.54	Sun Feb  1 21:54:30 2009
+++ loncom/localize/lonlocal.pm	Thu Feb  5 10:39:09 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Localization routines
 #
-# $Id: lonlocal.pm,v 1.54 2009/02/01 21:54:30 lueken Exp $
+# $Id: lonlocal.pm,v 1.55 2009/02/05 10:39:09 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -179,9 +179,9 @@
 
 # ===================================================== The "MakeText" function
 
-######### Localize Cache
-my @localize_cache;
-#########
+# ######### Localize Cache
+# my @localize_cache;
+# #########
 
 sub mt (@) {
 #    open(LOG,'>>/home/www/loncapa/loncom/localize/localize/newphrases.txt');
@@ -195,18 +195,19 @@
                 return $_[0];
             }
         } else {
-				######### Localize Cache
-				foreach my $e (@localize_cache)
-				{
-					if($_[0] eq $$e[0]) { return $$e[1]; }
-				}
-
-				if($#localize_cache == 100) { pop(@localize_cache); }
-				my $localize_entry = $lh->maketext(@_);
-				unshift(@localize_cache, [ @_, $localize_entry ] );
-				#########
-            
-	    		return $localize_entry;
+            return $lh->maketext(@_);
+#				######### Localize Cache
+#				foreach my $e (@localize_cache)
+#				{
+#					if($_[0] eq $$e[0]) { return $$e[1]; }
+#				}
+#
+#				if($#localize_cache == 100) { pop(@localize_cache); }
+#				my $localize_entry = $lh->maketext(@_);
+#				unshift(@localize_cache, [ @_, $localize_entry ] );
+#				#########
+#            
+#	    		return $localize_entry;
         }
     } else {
 	if (wantarray) {