Commit Graph

221 Commits (26dae8f04955915f4203fab4bd5301c959f7771a)

Author SHA1 Message Date
intrigeri 08df9dcef7 po plugin: memoize istranslatable and _istranslation
Both functions are called very often, and:
- istranslatable has no side effect
- _istranslation is the helper function, without any side effect, for the
  istranslation function

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 1e874b3f0a po plugin[filter]: avoid converting more than once per destfile
Only the first filter function call on a given {page,destpage} must convert it
from the PO file, subsequent calls must leave the passed $content unmodified.

Else, preprocessing loops are the rule.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 52728bb6ea po plugin: bugfix (calling function in wrong module)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 458ccebdd3 po plugin: added *.pot to wiki_file_prune_regexps
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri e163b037bf po plugin: move translatable pages to setup file, refactor
Replaced [[!translatable]] directive with po_translatable_pages setting.

Moved istranslatable/istranslation code to helper functions leaving place for
future caching and/or memoization. The PageSpec functions still work.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri ffd1fff775 po plugin: allow pagestate update (bugfix)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri b0b87d1584 po plugin: respect documented convention to store pagestate
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri 79d6f52d30 po plugin: implemented po_link_to=current
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri 0791e5afe3 po plugin: added istranslatable() pagespec function, and use it
(do not name non-translatable pages index.LL.html)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri fdc7974b2a po plugin: implemented po_link_to=negotiated
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri e82c6b1908 po plugin: implement linking specification in one of the main cases
i.e. in case usedirs is enabled and po_link_to_current_language is disabled

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri c8330da6c0 po plugin: add po_link_to_current_language option, check config
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri 1975d4d35f po plugin: use pagespec_match() instead of direct match_istranslation calls
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri 258c49ae55 po plugin: added [[!translatable]] directive
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri bd50ba3e83 po plugin: switch to page.LL.html naming convention
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri 45d08022bb po plugin: name rendered master pages like slave ones (page.html.LL)
Apache's content negotiation transparently redirects any old URL (page.html) to
the new one, depending on the client preferred language (i.e. a German browser
will be fed with page.html.de). Transition to this naming convention is then
really smooth.

This naming convention allows one to deliberately display the master page, even
if her browser is configured for another language.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri b90f8397f6 po plugin: reworked available options
- renamed po_supported_languages to po_slave_languages
- added po_master_language option, which will soon be useful

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 575d4021e3 po plugin: htmlize translated content as if it was the same type as the master page
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 1b5f610a97 po plugin: convert PO to master page's type in filter hook
Master page's type htmlize hook should also be run in po's htmlize hook,
but let's proceed step by step.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 75fc44ce2f po plugin: factorize most checks into a new match_istranslation PageSpec
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 50f1fd43da po plugin: initial work
- .po is a new supported wiki page type
- PO files are rendered verbatim into HTML
- override targetpage to ease Content Negotiation

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00