summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/po.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/po.pm')
-rw-r--r--IkiWiki/Plugin/po.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 205066341..5670f3608 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -39,6 +39,7 @@ sub import {
hook(type => "rename", id => "po", call => \&renamepages);
hook(type => "delete", id => "po", call => \&mydelete);
hook(type => "change", id => "po", call => \&change);
+ hook(type => "canremove", id => "po", call => \&canremove);
hook(type => "editcontent", id => "po", call => \&editcontent);
$origsubs{'bestlink'}=\&IkiWiki::bestlink;
@@ -406,6 +407,16 @@ sub change(@) {
}
}
+sub canremove ($$$) {
+ my ($page, $cgi, $session) = (shift, shift, shift);
+
+ if (istranslation($page)) {
+ return gettext("Can not remove a translation. Removing the master page,".
+ "though, removes its translations as well.");
+ }
+ return undef;
+}
+
# As we're previewing or saving a page, the content may have
# changed, so tell the next filter() invocation it must not be lazy.
sub editcontent () {