Commit Graph

1722 Commits (da26603e0780b3079ee8e94ec3651fdc615cc3f9)

Author SHA1 Message Date
intrigeri da26603e07 po: updated copyright years
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 16:54:03 +01:00
intrigeri fae3cef41a po(formbuilder_setup): remove the rename/remove buttons on slave pages
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-02 16:02:25 +01:00
intrigeri e5222db332 po: avoid warnings and possible bugs with nested named subroutines
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 15:14:58 +01:00
intrigeri 14a79751e3 po: gettext-ize error messages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 15:00:34 +01:00
intrigeri 724dbabc4a po: do not allow to create pages of type po
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-02 14:09:34 +01:00
intrigeri d1642e4cd9 po: cosmetic changes to percent translated display
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 12:36:07 +01:00
intrigeri f58cb48f1f po(formbuilder_setup): use a template to display the warning
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 12:27:10 +01:00
intrigeri 0f89ef0579 po: test formbuilder_setup hook to warn about new master page's language
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 12:15:21 +01:00
intrigeri 876808568e po: require ikiwiki plugin interface 3.0
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 11:22:54 +01:00
intrigeri 949c4c0c3a po: send msgfmt output to /dev/null, else it creates messages.mo files
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 23:33:16 +01:00
intrigeri d0c9c21687 po: fix error messages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 23:32:52 +01:00
intrigeri c821cee108 po(cansave): check PO validity using new isvalidpo function
... 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-01 23:12:08 +01:00
intrigeri a5de24ec97 skeleton plugin: added the canrename and canremove hooks
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 22:20:54 +01:00
intrigeri 1d3da099b4 po(cansave): use po_to_markup to check PO validity
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 22:16:43 +01:00
intrigeri 5ebb42494d po: move most of filter code to its own function
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-01 22:16:07 +01:00
intrigeri 41eca80e25 po: register a (dummy) cansave hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 19:48:48 +01:00
intrigeri d69fdf6445 editpage: added a cansave hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 19:48:27 +01:00
intrigeri e895157397 Pass src, srcfile, dest and destfile to the canrename hook.
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-01 18:04:37 +01:00
intrigeri 131d2d4e7c po: bugfix
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:56:51 +01:00
intrigeri 80a630a3fb po: fix canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:49:10 +01:00
intrigeri a8105f6859 rename: pass the CGI and session to the rename hook
The po plugin remame + canrename hook combination will need this.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:47:20 +01:00
intrigeri b24f236dfa po: use the new canrename hook to prevent translation renames in the CGI
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:52:43 +01:00
intrigeri 3316f9cc73 rename: implemented new canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:52:34 +01:00
intrigeri 741b26aa17 remove: implemented a new canremove hook; use it in the po plugin
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:44:39 +01:00
intrigeri 5c2f6cb893 Merge commit 'upstream/master' into prv/po 2009-01-01 13:34:00 +01:00
intrigeri c3af3840a2 Render.pm: also use 'our' for $backlinks_calculated
Since %backlinks are now declared with 'our', this variable must be as well.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 13:07:08 +01:00
intrigeri 5412a95fd0 po(myurlto): more robust run_by_editpage logic
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:14:06 +01:00
intrigeri 37b8822762 po: some code/comments refactoring
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:08:40 +01:00
intrigeri 856de5734d po: follow new coding style (removed Vim folding markers
)
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:08:35 +01:00
intrigeri 85f865b5d9 po: added postscan hook, to make pages depend on the pages linking to them
... so that nicepagetitle hook's effects, such as translation status displayed
in links, are updated when the linked page changes.

The replacement of 'my %backlinks' with 'our %backlinks' in Render.pm made this
work: previously, every postscan hook was called with an almost empty
%backlinks, which defeated all my attempts to implement this feature.

This feature hits performance a bit. Its cost was quite small in my real-world
use-cases (a few percents bigger refresh time), but could be bigger in worst
cases. Time will tell.

NB: this hack could also be used by my meta branch. It may even be a ikiwiki
optional feature.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:08:10 +01:00
intrigeri 885e4b607a po: new po_translation_status_in_links option
... to make configurable the last implemented feature.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 16:45:55 +01:00
intrigeri be092e5639 po(nicepagetitle): forgot to display %
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 16:34:08 +01:00
intrigeri 63c2bf57cb po(percenttranslated): fix issue with leading /
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 16:31:18 +01:00
intrigeri 0d874f0b69 po(nicepagetitle): append translation status to links to translated pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 15:45:05 +01:00
intrigeri 805e16ec65 po: inject our own (currently a no-op) nicepagetitle function
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 15:40:32 +01:00
intrigeri 149a3e65a7 po: fix redirect after edit, using a somehow tricky hack
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 13:02:48 +01:00
intrigeri bd10381103 po: delete translations of deleted master pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 11:47:18 +01:00
Joey Hess 3e8b7a6b19 websetup: Avoid a crash when a new array setup item has been added in a new ikiwiki release, and is thus not present in the setup file yet.
This happened with camelcase_ignore. The code tried to convert the undef
value for it into an array.
2008-12-31 00:44:54 -05:00
Joey Hess 0daa4eb521 make sure value is defined before using it as an array 2008-12-31 00:08:46 -05:00
intrigeri cd62acfb47 po: remove debug statements 2008-12-30 23:10:12 +01:00
intrigeri f586eafe90 po: remove renamed pages special handling, not needed anymore
Thanks to the new rename hook behaviour, the whole renaming work is now done
by the rename plugin, and we don't need to remember which pages were renamed.
2008-12-30 23:00:46 +01:00
intrigeri 5738f30a29 the rename hook can now change the list of pages to rename
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-30 22:55:04 +01:00
intrigeri c01485ae1a renamed the renamepage hook to renamelink, added rename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-30 21:36:40 +01:00
intrigeri 21add7ffa8 Merge commit 'upstream/master' into prv/po
Conflicts:

	debian/control
	debian/copyright
	doc/ikiwiki/pagespec.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-30 18:24:36 +01:00
Joey Hess f34dc3d8bd htmlbalance: Demand-load HTML::TreeBuilder to avoid failing test suite if it is not present. 2008-12-29 15:08:18 -05:00
Joey Hess 0711c0c548 comments: Add cache avoidance.
This got lost when we added the jump-to-comment anchor.
2008-12-28 22:20:22 -05:00
Joey Hess ec14786c90 releasing version 2.72 2008-12-28 15:05:05 -05:00
Joey Hess 25879952b1 typo 2008-12-26 21:45:12 -05:00
Joey Hess c4f3d0554a Merge branch 'master' into next 2008-12-26 16:11:13 -05:00
Joey Hess 7da319efc6 inline: Run format hook first
inline has a format hook that is an optimisation hack. Until this hook
runs, the inlined content is not present on the page. This can prevent
other format hooks, that process that content, from acting on inlined
content. In bug ##509710, we discovered this happened commonly for the
embed plugin, but it could in theory happen for many other plugins (color,
cutpaste, etc) that use format to fill in special html after sanitization.

The ordering was essentially random (hash key order). That's kinda a good
thing, because hooks should be independent of other hooks and able to run
in any order. But for things like inline, that just doesn't work.

To fix the immediate problem, let's make hooks able to be registered as
running "first". There was already the ability to make them run "last".

Now, this simple first/middle/last ordering is obviously not going to work
if a lot of things need to run first, or last, since then we'll be back to
being unable to specify ordering inside those sets. But before worrying about
that too much, and considering dependency ordering, etc, observe how few
plugins use last ordering: Exactly one needs it. And, so far, exactly one
needs first ordering. So for now, KISS.

Another implementation note: I could have sorted the plugins with
first/last/middle as the primary key, and plugin name secondary, to get a
guaranteed stable order. Instead, I chose to preserve hash order. Two
opposing things pulled me toward that decision:

1. Since has order is randomish, it will ensure that no accidental
   ordering assumptions are made.
2. Assume for a minute that ordering matters a lot more than expected.
   Drastically changing the order a particular configuration uses could
   result in a lot of subtle bugs cropping up. (I hope this assumption is
   false, partly due to #1, but can't rule it out.)
2008-12-26 16:09:23 -05:00