po: compute internal links from a slave page relative to its master page
authorintrigeri <intrigeri@boum.org>
Wed, 12 Nov 2008 14:04:50 +0000 (15:04 +0100)
committerintrigeri <intrigeri@boum.org>
Wed, 12 Nov 2008 14:04:50 +0000 (15:04 +0100)
e.g. a link appearing on a slave page links to its masterpage's subpages.

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

index 492b05c47ddb3dbbe297b8988f1205648e184c65..45ed96c65890020295b712697d63b738f8065a86 100644 (file)
@@ -390,7 +390,7 @@ sub mybestlink ($$) { #{{{
        my $page=shift;
        my $link=shift;
 
-       my $res=$origsubs{'bestlink'}->($page, $link);
+       my $res=$origsubs{'bestlink'}->(masterpage($page), $link);
        if (length $res
            && ($config{po_link_to} eq "current" || $config{po_link_to} eq "negotiated")
            && istranslatable($res)
index eeeabe7306fde63139c3334f6b6f2e43a33bc415..cb0dd65c0ebab3e7c3906c30e61c0a7ceff0c818 100644 (file)
@@ -198,14 +198,18 @@ Also, when the plugin has just been enabled, or when a page has just
 been declared as being translatable, the needed POT and PO files are
 created, and the PO files are checked into version control.
 
-Discussion pages
-----------------
+Discussion pages and other sub-pages
+------------------------------------
 
 Discussion should happen in the language in which the pages are
 written for real, *i.e.* the "master" one. If discussion pages are
 enabled, "slave" pages therefore link to the "master" page's
 discussion page.
 
+Likewise, "slave" pages are not supposed to have sub-pages;
+[[WikiLinks|wikilink]] that appear on a "slave" page therefore link to
+the master page's sub-pages.
+
 Translating
 -----------
 
@@ -499,11 +503,6 @@ gettext/po4a rough corners
 Better links
 ------------
 
-### Subpages
-
-On a translation page, links to subpages should actually be links to
-the master page's subpages. They currently appear as broken links.
-
 ### Page title in links
 
 To use the page titles set with the [[meta|plugins/meta]] plugin when