projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ebb424
)
po(cansave): use po_to_markup to check PO validity
author
intrigeri
<intrigeri@boum.org>
Thu, 1 Jan 2009 21:16:43 +0000
(22:16 +0100)
committer
intrigeri
<intrigeri@boum.org>
Thu, 1 Jan 2009 21:16:43 +0000
(22:16 +0100)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm
patch
|
blob
|
history
diff --git
a/IkiWiki/Plugin/po.pm
b/IkiWiki/Plugin/po.pm
index 13110d24295154eba6908b2591601050d095cb6a..35e7c13fffa1622e2060f3a03c8a07b9c9b8ca44 100644
(file)
--- 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 ($$$) {