web commit by JordaPolo: Added linguas plugin.
[ikiwiki.git] / doc / plugins / contrib / linguas.mdwn
1 Linguas
2 =======
3
4 Linguas is a plugin for [ikiwiki](http://ikiwiki.kitenet.net/) that
5 allows translations of wiki pages.
6
7 Download: [linguas.pm](http://wiki.ettin.org/files/linguas.pm) (2006-08-21).
8
9 Usage
10 -----
11
12 Translatable pages and translations must have the following format:
13 `pagename.$LANG`, where `$LANG` is a ISO639-1 (two-letter) language code.
14 To enable linguas, add the following line in the source code of the page:
15
16     [[linguas ]]
17
18 Note that linguas is only required in one of the pages (the original,
19 for instance); the rest of translations will be automatically
20 updated. Additionally, it is also possible to specify the title of
21 the translation:
22
23     [[linguas title="Translated title"]]
24
25
26 Template
27 --------
28
29 This is the template code that should be added to `templates/page.tmpl`:
30
31         <TMPL_IF NAME="LINGUAS">
32         <div id="linguas">
33         <p class="otherlinguas"><TMPL_VAR NAME="OTHERLINGUAS"></p>
34         <ul>
35         <TMPL_LOOP NAME="LINGUAS">
36         <li><TMPL_VAR NAME=LINK></li>
37         </TMPL_LOOP>
38         </ul>
39         </div>
40         </TMPL_IF>
41
42
43 TODO/Known Problems
44 -------------------
45
46 * The current language list only contains 4 languages (ca, de, en,
47 es), and is "hardcoded" in linguas.pm. Would be interesting to define
48 it in ikiwiki.setup, though some problems were found while trying to do
49 so. (Actually, defining hash-like arguments from the command like works
50 fine, but it fails from ikiwiki.setup.)
51
52 * Wiki links to other translated pages require the full page name
53 including the `.$LANG`. It should be possible to link automatically
54 to pages with the same `.$LANG`, but that would probably require some
55 changes in IkiWiki. (I'm not sure though, I still haven't looked at
56 it... any hints?)
57
58
59 Examples
60 --------
61
62 * [Linguas](http://wiki.ettin.org/linguas.en.html). A page with the same
63 content than this one.
64
65 * [Hello in some languages](http://wiki.ettin.org/hello/hello.en.html). The
66 translations were taken from [Hello in many
67 languages](http://www.omniglot.com/language/phrases/hello.htm) and from
68 the [Debian](http://www.debian.org/) website.