Commit Graph

130 Commits (b24f236dfa2903805bc233a7fc97101d912ae3ee)

Author SHA1 Message Date
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 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 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
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 5eed0fd97d po(change): reset renamed pages status at a better time
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 04:37:26 +01:00
intrigeri d795a295c9 po: initial infrastructure to deal with renamed master page
This is a skeleton that does nothing yet.
See the comments in the code for an overview of the issue that arises, due to
the renamepage hook never being called globally.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 03:55:55 +01:00
intrigeri c390056eb2 po(delete): added hook, and function skeleton
Not implemented yet, 'cos the renamepage hook has to come first.
Else translations would be deleted on rename, what a shame.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 01:38:22 +01:00
intrigeri cb1fe44f5d po(change): avoid losing information before guessing the same...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 01:07:52 +01:00
intrigeri 8745d67f06 po(istranslatablefile): extracted this from istranslatable
... will need this soon to deal with master file deletion.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 00:56:23 +01:00
intrigeri 190c641c8a po(otherlanguages): return pages that should exist
... instead of already existing ones.
This fixes the "missing otherlanguages links on master pages just created via
the CGI" bug.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 23:27:30 +01:00
intrigeri 36312b13b4 po: memoized istranslatable, eventually
And enjoy a 10% rebuild time enhancement on a complex wiki full of maps and
other pseudo-dynamic content, with some other costly plugins enabled. So it
could well mean 20% on a more usual wiki.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 22:32:47 +01:00
intrigeri 10c4e858b8 po(change): flush Memoize cache, to fix bug after rename/remove
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 21:18:48 +01:00
intrigeri c440a39ba4 po(htmlize): ignore PO files not managed by this plugin
This way, the po plugin will not appropriate PO files it is not responsible for,
and PO files existing before this plugin was enabled can coexist peacefully with
our own ones.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 18:06:04 +01:00
intrigeri 2f27eb9693 po: ooops, fixed just introduced bug
(I just removed in istranslation and _istranslation the dependency on
istranslatable... which broke things in a subtle way, hard to see at the first
glance.)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:52:00 +01:00
intrigeri aed42eb34a po: fix istranslation/istranslatable for pages starting with /
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:29:12 +01:00
intrigeri f4815e3b12 po(mybestlink): fixed when fed with path beginning with /
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 16:54:51 +01:00
intrigeri eba2dee941 po: compute internal links from a slave page relative to its master page
e.g. a link appearing on a slave page links to its masterpage's subpages.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 15:04:50 +01:00
intrigeri 40ffc92953 po: fixed bug when a new translatable page is created
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 23:04:58 +01:00
intrigeri 2b4e76a961 po: change a bit the way links are generated
This will soon enable usage of translated page titles in link.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 22:29:47 +01:00
intrigeri f0abaa9fc9 po: fixed link to home page when po_link_to=negotiated, added testcase
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 18:42:14 +01:00
intrigeri f0e796d9a1 po(change): fix uninitialized variables when running IkiWiki::refresh()
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 16:04:40 +01:00
intrigeri 43a1d36378 po: added HOMEPAGEURL template variable, documented when to use it
Hopefully all links should now be consistent with the chosen linking behavior,
but who knows...

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 15:27:39 +01:00
intrigeri cfe101fff9 po: fixed link to homepage from non-translation page
Added testcases for this bug.
It remains broken when generated from <TMPL_VAR BASEURL>, though.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 15:06:26 +01:00
intrigeri 6b82ef44b0 po: some code simplification/clarification
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 14:11:34 +01:00
intrigeri 0d8cbfc5e0 po(scan): make more clear what's being done
Mostly comments, and also a small code change: simplification and implementation
details hiding.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 04:32:20 +01:00
intrigeri d57ef86380 po: reorder nearly all of the module code
It has grown up incrementally and new helper functions were added right in the
middle of the hooks, most often near the place they were used, which is
practical when doing initial development, but quite ugly afterwards, when helper
functions are useful to separate logic and implementation details.

Today's refactoring commits have brought the code to a much more maintainable
state, IMHO.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 04:05:39 +01:00
intrigeri a7d329c173 po(match_lang, match_currentlang): use the lang() function
... now that it exists, instead of duplicating it.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 21:30:06 +01:00
intrigeri b4ab0d0b9e po: rewrote otherlanguagesloop()
It is now more elegant IMHO, and the output is now sorted according to the
language name (instead of code).

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 21:19:21 +01:00
intrigeri c5513548c9 po: factorize extraction of a slave page's masterpage and lang
The very same code was repeated at dozens of places.

NB: the real work is now done is _istranslation(), which is memoized,
so the additional function calls overhead should be compensated.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 20:40:44 +01:00
intrigeri 864bc2d9d0 po(otherlanguagesloop): start factorizing
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 18:38:25 +01:00
intrigeri 1255acc02c po: finish abstracting %filtered by putting it into a blackbox
i.e. it is invisible for everyone but its accessors/mutators

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 15:30:49 +01:00
intrigeri 38cdda66d7 po: actually use pofiles() function, to enhance code clarity
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 15:09:56 +01:00
intrigeri 5575786803 po: abstract "doing something for the same page in every other language"
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 14:55:21 +01:00
intrigeri 532ec56a5f po: abstract implementation details for %translations building and resetting
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:56:46 +01:00
intrigeri 3174b4c6f3 po: abstract %filtered implementation details
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:51:00 +01:00
intrigeri 00732f19b9 po: clarify error messages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:22:50 +01:00
intrigeri 6fc898df75 po: clarify code with some comments
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:14:42 +01:00