X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/127a8a3701dd41285f0f989546f758f93ee53dba..9b16e7f148c36c61e511bcc787d3192b7bb1c3c5:/IkiWiki/Plugin/po.pm diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 9dda8c0db..4bac37656 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -31,7 +31,7 @@ $origsubs{'bestlink'}=\&IkiWiki::bestlink; $origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath; $origsubs{'targetpage'}=\&IkiWiki::targetpage; -sub import { +sub import { #{{{ hook(type => "getsetup", id => "po", call => \&getsetup); hook(type => "checkconfig", id => "po", call => \&checkconfig); hook(type => "needsbuild", id => "po", call => \&needsbuild); @@ -41,13 +41,13 @@ sub import { inject(name => "IkiWiki::bestlink", call => \&mybestlink); inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); inject(name => "IkiWiki::targetpage", call => \&mytargetpage); -} +} #}}} sub getsetup () { #{{{ return plugin => { safe => 0, - rebuild => 1, # format plugin + rebuild => 1, # format plugin & changes html filenames }, po_master_language => { type => "string", @@ -149,8 +149,7 @@ sub refreshpofiles ($@) { #{{{ foreach my $pofile (@pofiles) { if (-e $pofile) { - my $cmd = "msgmerge -U --backup=none $pofile $potfile"; - system ($cmd) == 0 + system("msgmerge", "-U", "--backup=none", $pofile, $potfile) == 0 or error("[po/refreshpofiles:$pofile] failed to update"); } else { @@ -290,8 +289,8 @@ sub filter (@) { #{{{ my $destpage = $params{destpage}; my $content = decode_utf8(encode_utf8($params{content})); - # decide if this is a PO file that should be converted into a translated document, - # and perform various sanity checks + # decide if this is a PO file that should be converted into a + # translated document, and perform various sanity checks if (! istranslation($page) || $filtered{$page}{$destpage}) { return $content; }