[Po4a-commits] po4a/lib/Locale/Po4a TeX.pm,1.23,1.24

Nicolas FRAN??OIS po4a-devel@lists.alioth.debian.org
Thu, 17 Feb 2005 23:23:58 +0000


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv1883/lib/Locale/Po4a

Modified Files:
	TeX.pm 
Log Message:
Command behaviour specified on command line should override the behaviour
specified in the module.


Index: TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- TeX.pm	15 Feb 2005 23:19:02 -0000	1.23
+++ TeX.pm	17 Feb 2005 23:23:55 -0000	1.24
@@ -1101,10 +1101,6 @@
         }
     }
 
-    if ($options{'untranslated'}) {
-        $command_categories{'untranslated'} .=
-            join(' ', split(/,/, $options{'untranslated'}));
-    }
     foreach (split(/ /, $command_categories{'untranslated'})) {
         if (defined($commands{$_})) {
             # FIXME: Should we allow to redefine commands
@@ -1114,10 +1110,6 @@
         $commands{$_} = \&untranslated;
     }
 
-    if ($options{'translate'}) {
-        $command_categories{'translate_joined'} .=
-            join(' ', split(/,/, $options{'translate_joined'}));
-    }
     foreach (split(/ /, $command_categories{'translate_joined'})) {
         if (defined($commands{$_})) {
             # FIXME: Should we allow to redefine commands
@@ -1125,6 +1117,19 @@
             #        gettextization.
         }
         $commands{$_} = \&translate_joined;
+    }
+
+    # commands provided on the command line have an higher priority
+    # FIXME: commands defined in the files have an even higher priority
+    if ($options{'translate'}) {
+        foreach (split(/,/, $options{'translate'})) {
+            $commands{$_} = \&translate_joined;
+        }
+    }
+    if ($options{'untranslated'}) {
+        foreach (split(/,/, $options{'untranslated'})) {
+            $commands{$_} = \&untranslated;
+        }
     }
 
     # build an hash with keys in $separated_commands to ease searches.