[Po4a-commits] "po4a po4a,1.66,1.67 changelog,1.146,1.147"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Thu Nov 30 21:00:39 CET 2006
Update of /cvsroot/po4a/po4a
In directory alioth:/tmp/cvs-serv15447
Modified Files:
po4a changelog
Log Message:
(Splitted mode) When we create the big merged po, if an header differ, the
big PO's header is completely crap. So we have to use msgmerge -U, and we
have to create a initial PO with at least a good header (with msggrep or
msginit). Thanks to Azamat H. Hackimov.
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- po4a 30 Nov 2006 19:46:05 -0000 1.66
+++ po4a 30 Nov 2006 20:00:37 -0000 1.67
@@ -826,7 +826,24 @@
or die wrap_msg(
gettext("Can't create a temporary pot file: %s"), $!);
- my $cmd = "msggrep -N '$master' -o $tmp_file $po_filename{$lang}";
+ my $cmd;
+ # Create an empty PO or copy the original PO header.
+ # This permits to keep the header.
+ if (-f $splitted_po{$lang}{$master}) {
+ $cmd = "msggrep --force-po -v -K -e '.'".
+ " -o ".$tmp_file.
+ " ".$splitted_po{$lang}{$master};
+ } else {
+ $cmd = "msginit --no-translator -l ".$lang.
+ " -i ".$splitted_pot{$master}.
+ " -o ".$tmp_file;
+ }
+ run_cmd($cmd);
+
+ # Update the PO according to the new POT and to the big PO
+ # (compendium).
+ $cmd = "msgmerge -U -C ".$po_filename{$lang}.
+ " --backup=none ".$tmp_file." ".$splitted_pot{$master};
run_cmd($cmd);
my $dir = dirname($splitted_po{$lang}{$master});
Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/changelog,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- changelog 30 Nov 2006 19:46:05 -0000 1.146
+++ changelog 30 Nov 2006 20:00:37 -0000 1.147
@@ -1,6 +1,6 @@
2006-11-30 Nicolas François <nicolas.francois at centraliens.net>
- * po4a: In splitted mode, always add the directories (for POs and
+ * po4a: (Splitted mode) Always add the directories (for POs and
POTs). They were missing when --force is used.
* lib/Locale/Po4a/Po.pm: Export move_po_if_needed. Other
subroutine are not needed. They are object's methods.
@@ -15,6 +15,11 @@
* po4a: (Splitted mode) Always write in a temporary file, and at the
end, move it to the final location or use move_po_if_needed. This
was needed for the handling of backup files.
+ * po4a: (Splitted mode) When we create the big merged po, if an
+ header differ, the big PO's header is completely crap. So we have
+ to use msgmerge -U, and we have to create a initial PO with at
+ least a good header (with msggrep or msginit).
+ Thanks to Azamat H. Hackimov.
2006-11-25 Nicolas François <nicolas.francois at centraliens.net>
More information about the Po4a-commits
mailing list