po plugin(refreshpot): prevent PO references to be written
... 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>master
parent
a0deb3038c
commit
629968fc89
|
@ -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);
|
||||
} #}}}
|
||||
|
|
Loading…
Reference in New Issue