summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/po.pm
AgeCommit message (Collapse)Author
2009-04-20po: remove unneeded check on link pluginintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-29wrappingJoey Hess
2009-03-29whitespaceJoey Hess
2009-03-29minor code changesJoey Hess
2009-03-08rename hook: run once per file to be renamedintrigeri
... as Joey suggested on todo/need_global_renamepage_hook This hook is applied recursively to returned additional rename hashes, so that it handles the case where two plugins use the hook: plugin A would see when plugin B adds a new file to be renamed. The full set of rename hashes can no longer be changed by hook functions, that are only allowed to return any additional rename hashes it wants to add. Rationale: the correct behavior of the recursion would be hard, if not impossible, to define, if already considered pages were changing on the run. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27po: remove all dependencies on nicepagetitleintrigeri
... as my meta branch probably won't be merged before the po plugin is, contrary to what I was originally supposing. This implies removing the po_translation_status_in_links and po_strictly_refresh_backlinks options. Added a note to the TODO section to think of bringing these features back later, as they really enhance user experience on a translatable wiki. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27rename hook: instead of modifying the passed-by-name array, return a copyintrigeri
This is intended to solve Joey's concerns expressed on http://ikiwiki.info/todo/need_global_renamepage_hook/, i.e. the need to make it possible to use this hook from external plugins. A plugin using this hook still can add/modify/remove elements of the @torename array. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27po: make the "backlinks involve dependencies" feature optionalintrigeri
It can now be configured with the po_strictly_refresh_backlinks setting. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26po: bring back a useful use of scalarintrigeri
... that was removed in 68869d664b978b063c9181d024edb34a63306c33 Without this scalar, a two-cells array is passed to $template->param, which builds a hash with an odd number of elements. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26only pass named parameters to the canremove hookintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26only pass named parameters to the canrename hookintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26po(formbuilder): stop hunting down non-existent casesintrigeri
After some thinking about it, I can't find why the type of a page being created in the CGI could be restricted to po. So the previous case seems enough. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26remove redundant useJoey Hess
use is file-scoped so warnings and strict are already enabled inside the second package, and IkiWiki is already loaded (though not imported into this context)
2009-01-26non-code changesJoey Hess
2009-01-26more unnecessary parensJoey Hess
2009-01-26avoid keeping running if a DOS attack is possibleJoey Hess
2009-01-26remove unnecessary parensJoey Hess
2009-01-26another useless use of scalarJoey Hess
scalar(undef) is undef, so using scalar here had no effect. Instead make the function return "", probably avoiding an uninitialized value warning.
2009-01-26remove useless uses of scalarJoey Hess
if (scalar @array) is written idiomatically in perl as if (@array).
2009-01-26improve some englishJoey Hess
I'm still not happy with the clarity of this warning message. I don't understand when it could happen or why a warning is needed.
2009-01-26avoid standalone -e or foo syntaxJoey Hess
I prefer to use either of the other two syntaxes perl offers, and not this one.
2009-01-19remove cansave plugin, now replaced by Joey's checkcontent oneintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-16po: when possible, disable use of Text::WrapI18N in po4a; else warn about ↵intrigeri
too old po4a Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-16po(change): re-render all rendered files in one corner caseintrigeri
All meta titles are first extracted at scan time, i.e. before we turn PO files back into translated markdown; escaping of double-quotes in PO files breaks the meta plugin's parsing enough to save ugly titles to %pagestate at this time. Then, at render time, every page's passes on row through the Great Rendering Chain (filter->preprocess->linkify->htmlize), and the meta plugin's preprocess hook is this time in a position to correctly extract the titles from slave pages. This is, unfortunately, too late: if the page A, linking to the page B, is rendered before B, it will display the wrongly-extracted meta title as the link text to B. On the one hand, such a corner case only happens on rebuild: on refresh, every rendered page is fixed to contain correct meta titles. On the other hand, it can take some time to get every page fixed. We therefore re-render every rendered page after a rebuild to fix them at once. As this more or less doubles the time needed to rebuild the wiki, we do so only when really needed. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-15po: pages in underlay dirs are not translatableintrigeri
Fixes build break due to read-only underlay dirs, e.g. basewiki. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-15po(_istranslation): fix unitialized valueintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-15po: fix broken links from slave pagesintrigeri
... by overriding cgiurl. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-13po: do not add translation status to parentlinksintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po(isvalidpo): more meaningful error messageintrigeri
... explaining how to go on with edit. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: back to the cansave hook, as the form validation is not sufficientintrigeri
Form validation works, but after trying to save invalid PO content, the user is brought back to the page he/she was editing, without any single clue to explain why it was not saved. The dedicated cansave hook is thus necessary. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: first attempt to replace cansave hook with form validate tweaksintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po/i18n: move the function names out of the translatable stringsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: updated copyright yearsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po(formbuilder_setup): remove the rename/remove buttons on slave pagesintrigeri
This has to be done after the rename/remove plugins have added their buttons, so we set this hook to be run last. The canrename/canremove hooks already ensure this is forbidden at the backend level, so this is only UI sugar. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: avoid warnings and possible bugs with nested named subroutinesintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: gettext-ize error messagesintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: do not allow to create pages of type pointrigeri
The main reason to do so is to bypass the "favor the type of linking page on page creation" logic, which is unsuitable when a broken link is clicked on a slave (PO) page. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: cosmetic changes to percent translated displayintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po(formbuilder_setup): use a template to display the warningintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: test formbuilder_setup hook to warn about new master page's languageintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02po: require ikiwiki plugin interface 3.0intrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po: send msgfmt output to /dev/null, else it creates messages.mo filesintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po: fix error messagesintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po(cansave): check PO validity using new isvalidpo functionintrigeri
... because Po4a's parser does not care about malformed PO data. Use gettext's msgfmt program instead. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po(cansave): use po_to_markup to check PO validityintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po: move most of filter code to its own functionintrigeri
Allow this new po_to_markup function to run in non-fatal mode, we need this in our cansave hook. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po: register a (dummy) cansave hookintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01Pass src, srcfile, dest and destfile to the canrename hook.intrigeri
This is not needed by the use I'm doing of it, but seems more consistent to me. Future users of this hook may need this data to make their mind. Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po: bugfixintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01po: fix canrename hookintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>