]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/po.mdwn
po plugin: added todo note about optimization
[ikiwiki.git] / doc / plugins / po.mdwn
index d2f572706eaf3d5c268ba4e445a683b017961f5e..f71a36739f18f3f56ad97648d45ba47270b41875 100644 (file)
@@ -46,36 +46,15 @@ languages, such as:
                                 'de' => { 'name' => 'Deutsch', }
         }
 
+Decide which pages are translatable
+-----------------------------------
 
-Server support
-==============
-
-Apache
-------
-
-Using `mod_negotiation` makes it really easy to have Apache serve the
-page in the client's preferred language, if available. This is the
-default Debian Apache configuration.
-
-When `usedirs` is enabled, one has to set `DirectoryIndex index` for
-the wiki context.
-
-Setting `DefaultLanguage LL` (replace `LL` with your default MIME
-language) for the wiki context can be needed, to ensure
-`bla/page/index.en.html` is served as `Content-Language: LL`.
-**FIXME**: is it still needed with the new `.en.html` naming convention?
-
-lighttpd
---------
-
-lighttpd unfortunately does not support content negotiation.
-
-**FIXME**: does `mod_magnet` provide the functionality needed to
- emulate this?
-
+The subset of "master" pages subject to translation is configurable:
 
-TODO
-====
+- a `[[!translatable ]]` directive, when put on a page, makes it
+  translatable
+- to set at once a bunch of pages as being translatable, use this
+  [[ikiwiki/directive]] with the `match=PageSpec` argument.
 
 Internal links
 --------------
@@ -98,7 +77,8 @@ negotiated preferred language, *i.e.* `foo/page/`.
 (In)compatibility notes:
 
 - `po_link_to => negotiated` provides no useful behavior if `usedirs`
-  is disabled: 
+  is disabled; this option combination is neither implemented nor
+  allowed
 - `po_link_to => negotiated` provides no useful behavior if the web
   server does not support Content Negotiation
 
@@ -111,6 +91,46 @@ page's language, *i.e.*:
 - `foo/page/index.LL.html` if `usedirs` is enabled
 - `foo/page.LL.html` if `usedirs` is disabled
 
+
+Server support
+==============
+
+Apache
+------
+
+Using `mod_negotiation` makes it really easy to have Apache serve the
+page in the client's preferred language, if available. This is the
+default Debian Apache configuration.
+
+When `usedirs` is enabled, one has to set `DirectoryIndex index` for
+the wiki context.
+
+Setting `DefaultLanguage LL` (replace `LL` with your default MIME
+language) for the wiki context can be needed, to ensure
+`bla/page/index.en.html` is served as `Content-Language: LL`.
+**FIXME**: is it still needed with the new `.en.html` naming convention?
+
+lighttpd
+--------
+
+lighttpd unfortunately does not support content negotiation.
+
+**FIXME**: does `mod_magnet` provide the functionality needed to
+ emulate this?
+
+
+TODO
+====
+
+Optimization
+------------
+
+Move `match_istranslation` and `match_istranslatable` code into helper
+functions, and pre-compute what can be early in the build process:
+
+- the list of translatable (master) pages
+- for every translatable page, the list of slave pages
+
 Display available translations
 ------------------------------
 
@@ -130,17 +150,6 @@ implemented as a
 loop, a page using it should depend on any "master" and "slave" pages
 whose status is being displayed.
 
-Decide which pages are translatable
------------------------------------
-
-The subset of "master" pages subject to translation must be
-configurable:
-
-- a `[[!translatable ]]` directive, when put on a page, makes it
-  translatable
-- to set at once a bunch of pages as being translatable, use this
-  [[ikiwiki/directive]] with the `match=PageSpec` argument.
-
 Automatic PO files update
 -------------------------