po(cansave): use po_to_markup to check PO validity
Signed-off-by: intrigeri <intrigeri@boum.org>master
parent
5ebb42494d
commit
1d3da099b4
|
@ -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 ($$$) {
|
||||||
|
|
Loading…
Reference in New Issue