]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/po.mdwn
po plugin: update doc (move finished item from todo)
[ikiwiki.git] / doc / plugins / po.mdwn
index fd8a50e0bb455b3dea0c93cc9c0439f87c3c8600..69fce52efe8767c682c3deb784725bae8da3df7f 100644 (file)
@@ -46,6 +46,51 @@ languages, such as:
                                 'de' => { 'name' => 'Deutsch', }
         }
 
+Decide which pages are translatable
+-----------------------------------
+
+The subset of "master" pages subject to translation is 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.
+
+Internal links
+--------------
+
+One can use the `po_link_to_` option in `ikiwiki.setup` to choose how
+internal links should be generated, depending on web server features
+and site-specific preferences.
+
+### Default linking behavior
+
+If `po_link_to` is unset, or set to `default`, ikiwiki's default
+linking behavior is preserved: `[[page]]` links to the master
+language's page.
+
+### Link to negotiated language
+
+If `po_link_to` is set to `negotiated`, `[[page]]` links to the
+negotiated preferred language, *i.e.* `foo/page/`.
+
+(In)compatibility notes:
+
+- `po_link_to => negotiated` provides no useful behavior if `usedirs`
+  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
+
+### Link to current language
+
+If `po_link_to` is set to `current` and the destination page is either
+a translatable page or a translation, `[[page]]` links to the current
+page's language, *i.e.*:
+
+- `foo/page/index.LL.html` if `usedirs` is enabled
+- `foo/page.LL.html` if `usedirs` is disabled
+
 
 Server support
 ==============
@@ -77,29 +122,6 @@ lighttpd unfortunately does not support content negotiation.
 TODO
 ====
 
-Links
------
-
-Choice between two behaviors must be possible in `ikiwiki.setup`;
-a `po_link_to_current_language` option must allow switching
-between them.
-
-If `po_link_to_current_language` is disabled, `[[page]]` links to the
-negotiated preferred language, i.e.:
-
-- `usedirs` enabled: `bla/page/`
-- `usedirs` disabled: `bla/page`
-
-This obviously does not work in case Content Negotiation is not
-supported by the web server, hence one can enable
-`po_link_to_current_language` to make `[[page]]` link to the current
-page's language, i.e.:
-
-- `usedirs` enabled: `bla/page/index.LL.html`
-- `usedirs` disabled: `bla/page.LL.html`
-
-**FIXME**: should `po_link_to_current_language` be enabled by default?
-
 Display available translations
 ------------------------------
 
@@ -119,17 +141,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
 -------------------------