[LON-CAPA-cvs] cvs: loncom /localize/localize synch.pl

bisitz bisitz@source.lon-capa.org
Fri, 16 Jan 2009 15:20:29 -0000


bisitz		Fri Jan 16 15:20:29 2009 EDT

  Modified files:              
    /loncom/localize/localize	synch.pl 
  Log:
  - Added warning and debug messages for new keys which contain both, ' and ".
  - Removed two unneeded blanks at end of line
  
  
Index: loncom/localize/localize/synch.pl
diff -u loncom/localize/localize/synch.pl:1.11 loncom/localize/localize/synch.pl:1.12
--- loncom/localize/localize/synch.pl:1.11	Thu Jan 15 11:28:12 2009
+++ loncom/localize/localize/synch.pl	Fri Jan 16 15:20:29 2009
@@ -13,7 +13,7 @@
 # Add a translation help comment after each new translation.
 # This comment contains a combination of translations which are built by using already existing translations.
 # 1: add, 0: don't add
-my $helper=0; 
+my $helper=0;
 
 # Debug Mode
 # Displays additional output for debugging purposes
@@ -81,7 +81,7 @@
     }
     return 0;
 }
-  
+
 
 
 # ----------------------------------------------------------------
@@ -127,6 +127,7 @@
 
 
 print "Synchronization:\n";
+my $quotwarn=0;
 foreach my $fn (<*.pm>) {
     if (&ignorefile($fn)) { next }
     print "  Synching '".$fn."'... ";
@@ -141,7 +142,7 @@
     open(OUT,'>'.$fn) or die;
     my $found=0;
     while (<IN>) {
-	if ($_=~/\#\s*SYNCMARKER/) { $found=1; last; } 
+	if ($_=~/\#\s*SYNCMARKER/) { $found=1; last; }
 	print OUT $_;
     }
     # Append missing phrases to new version of current translation file
@@ -174,6 +175,11 @@
 		    $num='';
 		}
                 # Find delimiter for key and value
+		if (($key=~/\'/) & ($key=~/\"/)) {
+		    $quotwarn++;
+		    print " Warning: Both, ' and \",occur!" if $debug;
+		}
+		# if (($key=~/[^\\]\'/) | ($key=~/\\\"/)) {
 		if ($key=~/\'/) {
 		    $dlm='"';
 		} else {
@@ -202,5 +208,8 @@
     print "\n" if $debug;
     print"$i added... ok.\n";
 }
+if ($quotwarn) {
+    print "Warning: Issues expected due to occurrence of ' and \" in $quotwarn new key(s).\n";
+}
 print "Synchronization completed.\n";