po(cansave): use po_to_markup to check PO validity

Signed-off-by: intrigeri <intrigeri@boum.org>
master
intrigeri 2009-01-01 22:16:43 +01:00
parent 5ebb42494d
commit 1d3da099b4
1 changed files with 9 additions and 1 deletions

View File

@ -387,7 +387,15 @@ sub change(@) {
sub cansave ($$$$) { sub cansave ($$$$) {
my ($page, $content, $cgi, $session) = (shift, shift, shift, shift); 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 ($$$) { sub canremove ($$$) {