]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po plugin(refreshpot): prevent PO references to be written
authorintrigeri <intrigeri@boum.org>
Sat, 18 Oct 2008 19:47:49 +0000 (21:47 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 18 Oct 2008 19:47:49 +0000 (21:47 +0200)
... else we can fall into some kind of nasty infinite loop, when two ikiwiki
instances don't store their working copy of the repository at the same place:
every POT file update in one repository would trigger an update of the same POT
file in the others repository, and so on.

Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index 07896d95ab274958079c6711aeb281541e4af385..26bd893a91d6e20abacd1ebb22ffd68868f385b3 100644 (file)
@@ -9,6 +9,7 @@ use strict;
 use IkiWiki 2.00;
 use Encode;
 use Locale::Po4a::Chooser;
+use Locale::Po4a::Po;
 use File::Basename;
 use File::Copy;
 use File::Spec;
@@ -119,6 +120,12 @@ sub refreshpot ($) { #{{{
        $doc->{TT}{utf_mode} = 1;
        $doc->{TT}{file_in_charset} = 'utf-8';
        $doc->{TT}{file_out_charset} = 'utf-8';
+       # let's cheat a bit to force porefs option to be passed to Locale::Po4a::Po;
+       # this is undocument use of internal Locale::Po4a::TransTractor's data,
+       # compulsory since this module prevents us from using the porefs option.
+       my %po_options = ('porefs' => 'none');
+       $doc->{TT}{po_out}=Locale::Po4a::Po->new(\%po_options);
+       # do the actual work
        $doc->parse;
        $doc->writepo($potfile);
 } #}}}