From: intrigeri <intrigeri@boum.org>
Date: Fri, 28 Aug 2009 11:57:15 +0000 (+0200)
Subject: po: keep masterpage as the rootpage for inline's post form
X-Git-Tag: 3.1415926~10^2~5
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/cf43ae5a1f5460a98cdd7acb36c0691b2eec988f?hp=-c

po: keep masterpage as the rootpage for inline's post form

Signed-off-by: intrigeri <intrigeri@boum.org>
---

cf43ae5a1f5460a98cdd7acb36c0691b2eec988f
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 55c1c32c6..103347c37 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -564,9 +564,13 @@ sub mybestlink ($$) {
 	my $link=shift;
 
 	my $res=$origsubs{'bestlink'}->(masterpage($page), $link);
+	my @caller = caller(1);
 	if (length $res
 	    && istranslatable($res)
-	    && istranslation($page)) {
+	    && istranslation($page)
+	    # keep masterpage as the rootpage for inline's post form
+	    && !(exists $caller[3] && defined $caller[3]
+		 && ($caller[3] eq "IkiWiki::rootpage"))) {
 		return $res . "." . lang($page);
 	}
 	return $res;