`po_master_language` is used to set the "master" language in
`ikiwiki.setup`, such as:
- po_master_language => { 'code' => 'en', 'name' => 'English' }
+ po_master_language: en|English
`po_slave_languages` is used to set the list of supported "slave"
languages, such as:
- po_slave_languages => { 'fr' => 'Français',
- 'es' => 'Español',
- 'de' => 'Deutsch',
- }
+ po_slave_languages:
+ - fr|Français
+ - es|Español
+ - de|Deutsch
Decide which pages are translatable
-----------------------------------
Using Apache `mod_negotiation` makes it really easy to have Apache
serve any 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.
+Add 'Options MultiViews' to the wiki directory's configuration in Apache.
-Setting `DefaultLanguage LL` (replace `LL` with your default MIME
-language code) for the wiki context can help to ensure
-`bla/page/index.en.html` is served as `Content-Language: LL`.
+When `usedirs` is enabled, you should also set `DirectoryIndex index`.
+
+These settings are also recommended, in order to avoid serving up rss files
+as index pages:
+
+ AddType application/rss+xml;qs=0.8 .rss
+ AddType application/atom+xml;qs=0.8 .atom
+
+For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/content-negotiation.html).
lighttpd
--------
-lighttpd unfortunately does not support content negotiation.
+Recent versions of lighttpd should be able to use
+`$HTTP["language"]` to configure the translated pages to be served.
-**FIXME**: does `mod_magnet` provide the functionality needed to
- emulate this?
+See [Lighttpd Issue](http://redmine.lighttpd.net/issues/show/1119)
+TODO: Example
Usage
=====
The `ISTRANSLATION` and `ISTRANSLATABLE` variables can be used to
display things only on translatable or translation pages.
+The `LANG_CODE` and `LANG_NAME` variables can respectively be used to
+display the current page's language code and pretty name.
+
### Display page's versions in other languages
The `OTHERLANGUAGES` loop provides ways to display other languages'
discussion page.
Likewise, "slave" pages are not supposed to have sub-pages;
-[[WikiLinks|wikilink]] that appear on a "slave" page therefore link to
+[[WikiLinks|ikiwiki/wikilink]] that appear on a "slave" page therefore link to
the master page's sub-pages.
Translating
Markup languages support
------------------------
-[[Markdown|mdwn]] is well supported. Some other markup languages supported
-by ikiwiki mostly work, but some pieces of syntax are not rendered
-correctly on the slave pages:
+[[Markdown|mdwn]] and [[html]] are well supported. Some other markup
+languages supported by ikiwiki mostly work, but some pieces of syntax
+are not rendered correctly on the slave pages:
* [[reStructuredText|rst]]: anonymous hyperlinks and internal
cross-references
* [[wikitext]]: conversion of newlines to paragraphs
* [[creole]]: verbatim text is wrapped, tables are broken
-* [[html]] and LaTeX: not supported yet; the dedicated po4a modules
- could be used to support them, but they would need a security audit
+* LaTeX: not supported yet; the dedicated po4a module
+ could be used to support it, but it would need a security audit
* other markup languages have not been tested.
+Renaming a page
+---------------
+
+A translatable page may be renamed using the web interface and the
+[[rename plugin|plugins/rename]], or using the VCS directly; in
+the latter case, *both* the "master" page and every corresponding
+`.po` file must be renamed in the same commit.
+
Security
========
`Text::WrapI18N` (Debian package `libtext-wrapi18n-perl`), in order to
avoid a potential denial of service.
-TODO
+BUGS
====
-Better links
-------------
-
-Once the fix to
-[[bugs/pagetitle_function_does_not_respect_meta_titles]] from
-[[intrigeri]]'s `meta` branch is merged into ikiwiki upstream, the
-generated links' text will be optionally based on the page titles set
-with the [[meta|plugins/meta]] plugin, and will thus be translatable.
-It will also allow displaying the translation status in links to slave
-pages. Both were implemented, and reverted in commit
-ea753782b222bf4ba2fb4683b6363afdd9055b64, which should be reverted
-once [[intrigeri]]'s `meta` branch is merged.
-
-An integration branch, called `meta-po`, merges [[intrigeri]]'s `po`
-and `meta` branches, and thus has thise additional features.
-
+[[!inline pages="bugs/po:* and !bugs/done and !link(bugs/done) and !bugs/*/*"
+feeds=no actions=no archive=yes show=0]]
-Language display order
-----------------------
-
-Jonas pointed out that one might want to control the order that links to
-other languages are listed, for various reasons. Currently, there is no
-order, as `po_slave_languages` is a hash. It would need to be converted
-to an array to support this. (If twere done, twere best done quickly.)
---[[Joey]]
-
-po files in underlay
---------------------
-
-I think this plugin doesn't yet allow po files to be present in an
-underlay to translate files also from the underlay.
-
-In `istranslatablefile`, it specifically checks that
-the file is present in srcdir.
-
-Problem with this is that it precludes using po to translate
-the basewiki (work which is well under way for Danish BTW),
-since the translated po files cannot really be used. --[[Joey]]
-
-Duplicate %links ?
-------------------
-
-I notice code in the scan hook that seems to assume
-that %links will accumulate duplicate links for a page.
-That used to be so, but the bug was fixed. Does this mean
-that po might be replacing the only link on a page, in error?
---[[Joey]]
-
-Documentation
--------------
+TODO
+====
-Maybe write separate documentation depending on the people it targets:
-translators, wiki administrators, hackers. This plugin may be complex
-enough to deserve this.
+[[!inline pages="todo/po:* and !todo/done and !link(todo/done) and !todo/*/*"
+feeds=no actions=no archive=yes show=0]]