[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 19 Apr 2004 21:28:19 -0000


matthew		Mon Apr 19 17:28:19 2004 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  &filedescription and &filedescriptionex: added regexp processing of 
  description to 'escape' [ and ] with '~'s prior to localization.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.187 loncom/interface/loncommon.pm:1.188
--- loncom/interface/loncommon.pm:1.187	Thu Mar 18 22:47:09 2004
+++ loncom/interface/loncommon.pm	Mon Apr 19 17:28:19 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.187 2004/03/19 03:47:09 albertel Exp $
+# $Id: loncommon.pm,v 1.188 2004/04/19 21:28:19 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1859,7 +1859,9 @@
 =cut
 
 sub filedescription {
-    return &mt($fd{lc(shift(@_))});
+    my $file_description = $fd{lc(shift())};
+    $file_description =~ s:([\[\]]):~$1:g;
+    return &mt($file_description);
 }
 
 =pod
@@ -1873,7 +1875,9 @@
 
 sub filedescriptionex {
     my $ex=shift;
-    return '.'.$ex.' '.&mt($fd{lc($ex)});
+    my $file_description = $fd{lc($ex)};
+    $file_description =~ s:([\[\]]):~$1:g;
+    return '.'.$ex.' '.&mt($file_description);
 }
 
 # End of .tab access