diff options
author | Amitai Schlair <schmonz@magnetic-babysitter.(none)> | 2009-08-30 16:34:32 -0400 |
---|---|---|
committer | Amitai Schlair <schmonz@magnetic-babysitter.(none)> | 2009-08-30 16:34:32 -0400 |
commit | fe350e8b895be69471fad094fcdcf0b4c7d3beb3 (patch) | |
tree | 5d48b57f583fedc2a9b765d3a9ea7b0c6c1d5891 /IkiWiki/Plugin/po.pm | |
parent | 1af7d7d8429b6e73493a5f8ba877c6cfb888cfe1 (diff) | |
parent | 7021fc36466d80ca0c4105b82239d3ba008ade80 (diff) |
Merge branch 'master' of git://github.com/joeyh/ikiwiki
Diffstat (limited to 'IkiWiki/Plugin/po.pm')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 792d84261..5d0d9e79d 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -51,6 +51,8 @@ sub import { hook(type => "formbuilder_setup", id => "po", call => \&formbuilder_setup, last => 1); hook(type => "formbuilder", id => "po", call => \&formbuilder); + $origsubs{'bestlink'}=\&IkiWiki::bestlink; + inject(name => "IkiWiki::bestlink", call => \&mybestlink); $origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath; inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); $origsubs{'targetpage'}=\&IkiWiki::targetpage; @@ -153,12 +155,6 @@ sub checkconfig () { warn(gettext('po_link_to=negotiated requires usedirs to be enabled, falling back to po_link_to=default')); $config{po_link_to}='default'; } - unless ($config{po_link_to} eq 'default') { - if (! exists $origsubs{'bestlink'}) { - $origsubs{'bestlink'}=\&IkiWiki::bestlink; - inject(name => "IkiWiki::bestlink", call => \&mybestlink); - } - } push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; @@ -562,11 +558,13 @@ sub formbuilder (@) { # `---- # Implement po_link_to 'current' and 'negotiated' settings. -# Not injected otherwise. sub mybestlink ($$) { my $page=shift; my $link=shift; + return $origsubs{'bestlink'}->($page, $link) + if $config{po_link_to} eq "default"; + my $res=$origsubs{'bestlink'}->(masterpage($page), $link); my @caller = caller(1); if (length $res |