summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-01-01 22:16:43 +0100
committerintrigeri <intrigeri@boum.org>2009-01-01 22:16:43 +0100
commit1d3da099b4763df37033e7955b8762f5b818d1b6 (patch)
tree817b25b62cd666937d4434aea541025d78103c6d /IkiWiki/Plugin
parent5ebb42494d64b58ce89664dea37d6634bb615d7d (diff)
po(cansave): use po_to_markup to check PO validity
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/po.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 13110d242..35e7c13ff 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -387,7 +387,15 @@ sub change(@) {
sub cansave ($$$$) {
my ($page, $content, $cgi, $session) = (shift, shift, shift, shift);
- debug("po plugin running in cansave")
+ if (istranslation($page)) {
+ if (defined po_to_markup($page, $content, "nonfatal")) {
+ return undef;
+ }
+ else {
+ return "Could not parse this page's content; is this valid gettext?";
+ }
+ }
+ return undef;
}
sub canremove ($$$) {