diff options
author | intrigeri <intrigeri@boum.org> | 2009-01-01 22:16:43 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-01-01 22:16:43 +0100 |
commit | 1d3da099b4763df37033e7955b8762f5b818d1b6 (patch) | |
tree | 817b25b62cd666937d4434aea541025d78103c6d /IkiWiki/Plugin | |
parent | 5ebb42494d64b58ce89664dea37d6634bb615d7d (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.pm | 10 |
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 ($$$) { |