Hi,

On Fri, Feb 05, 2010 at 03:51:31PM +0100, Yann Dirson wrote:
>
> Here is a simple patch allowing the following construct:
> 
> [type: xml] foo/res/gui.xml $lang:/dev/null master:foo
> [type: xml] bar/res/gui.xml $lang:/dev/null master:bar

I just updated your patch, against the current version of po4a. Anyway,
since [po4a_paths] is deprecated since [po_directory] can be used, I
wonder if split mode is still advised (if so, there must be some work
left in order to make your patch useful).

If the goal is to split parts of the translation, one can always use
different sub-directories, e.g. pod, bin and www in tho po4a program.

Cheers

David


--- /mnt/donnees/1/debian/po4a/po4a	2010-07-21 11:37:57.192986427 -0400
+++ po4a-now	2010-07-26 20:24:08.000000000 -0400
@@ -932,6 +932,13 @@
 	}
 	%{$document{$main}{'options'}} = %options;
 
+	# 5. Handle "master:" flags for "$master" substitution in strings
+	if ($args =~ m/^(.*?) +(?:master:(\S*))\s*$/) {
+	    $args = $1;
+	    $args = "" unless defined $args;
+	    $document{$main}{'master'} = $2;
+	}
+
 	chdir $po4a_opts{"srcdir"}
 	    if (defined $po4a_opts{"srcdir"});
 	my %discarded = ();
@@ -1059,7 +1066,8 @@
     }
     foreach my $master (keys %document) {
         next if ($master eq '');
-        my $m = basename $master;
+        my $m = $document{$master}{"master"};
+        $m = basename $master unless defined $m;
         my $master_pot = $pot_filename;
         $master_pot =~ s/\$master/$m/g;
         $split_pot{$master} = $master_pot;
@@ -1241,7 +1249,8 @@
         my $cmd_cat = "";
         foreach my $master (keys %document) {
             next if ($master eq '');
-            my $m = basename $master;
+            my $m = $document{$master}{"master"};
+            $m = basename $master unless defined $m;
             my $master_po = $po_filename{$lang};
             $master_po =~ s/\$master/$m/g;
             if (-e "$master_po") {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to