summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-02 18:48:56 +0100
committerintrigeri <intrigeri@boum.org>2008-11-02 18:48:56 +0100
commit950c29679df8f8f2f20e150896dc7ec686f123e8 (patch)
tree7ce79e5aa028b59a6d42f74143ae8d32b78d5be5
parent439a2d3c443a032b26ce2455c6f15352a7e606be (diff)
po plugin: replace targetpage hook with wrapper function
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r--IkiWiki/Plugin/po.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 9b5652561..127d6d47f 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -29,18 +29,19 @@ memoize("percenttranslated");
my %origsubs;
$origsubs{'bestlink'}=\&IkiWiki::bestlink;
$origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath;
+$origsubs{'targetpage'}=\&IkiWiki::targetpage;
sub import {
hook(type => "getsetup", id => "po", call => \&getsetup);
hook(type => "checkconfig", id => "po", call => \&checkconfig);
hook(type => "needsbuild", id => "po", call => \&needsbuild);
- hook(type => "targetpage", id => "po", call => \&targetpage);
hook(type => "tweakurlpath", id => "po", call => \&tweakurlpath);
hook(type => "filter", id => "po", call => \&filter);
hook(type => "htmlize", id => "po", call => \&htmlize);
hook(type => "pagetemplate", id => "po", call => \&pagetemplate);
inject(name => "IkiWiki::bestlink", call => \&mybestlink);
inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath);
+ inject(name => "IkiWiki::targetpage", call => \&mytargetpage);
}
sub getsetup () { #{{{
@@ -219,10 +220,9 @@ sub needsbuild () { #{{{
}
} #}}}
-sub targetpage (@) { #{{{
- my %params = @_;
- my $page=$params{page};
- my $ext=$params{ext};
+sub mytargetpage ($$) { #{{{
+ my $page=shift;
+ my $ext=shift;
if (istranslation($page)) {
my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/);
@@ -241,7 +241,7 @@ sub targetpage (@) { #{{{
return $page . "/index." . $config{po_master_language}{code} . "." . $ext;
}
}
- return;
+ return $origsubs{'targetpage'}->($page, $ext);
} #}}}
sub mybeautify_urlpath ($) { #{{{