X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/5085ae1360c30c163fef4de94dcc65fef9f5ef17..da9bf8df555465ab6ec79495239b78995e47939f:/doc/plugins/contrib/linguas.mdwn?ds=inline diff --git a/doc/plugins/contrib/linguas.mdwn b/doc/plugins/contrib/linguas.mdwn index c1f1bfcb0..204910290 100644 --- a/doc/plugins/contrib/linguas.mdwn +++ b/doc/plugins/contrib/linguas.mdwn @@ -1,12 +1,17 @@ -[[template id=plugin name=linguas author="""Jordà Polo"""]] +[[template id=plugin name=linguas author="Jordà Polo"]] Linguas ======= -Linguas is a plugin for [ikiwiki](http://ikiwiki.kitenet.net/) that +Linguas is a plugin for [ikiwiki](http://ikiwiki.info/) that allows translations of wiki pages. -Download: [linguas.pm](http://wiki.ettin.org/files/linguas.pm) (2006-08-21). +Download: [linguas.pm](http://ettin.org/pub/ikiwiki/linguas.pm) (2006-08-21). + +Note that even though it is still available for download, this plugin is no +longer actively maintained. If you are interested in multilingual wiki pages, you +can also take a look at other approaches such as [[todo/l10n]] or Lars Wirzenius's +[Static website, with translations, using IkiWiki](http://liw.iki.fi/liw/log/2007-05.html#20070528b). Usage ----- @@ -51,9 +56,18 @@ it in ikiwiki.setup, though some problems were found while trying to do so. (Actually, defining hash-like arguments from the command like works fine, but it fails from ikiwiki.setup.) - > My guess about this is that it's because of the way Setup/Standard.pm untaints the config items from the file. It has code to handle arrays, but not hashes or more complex data structures. --[[Joey]] + > My guess about this is that it's because of the way Setup/Standard.pm + > untaints the config items from the file. It has code to handle arrays, + > but not hashes or more complex data structures. --[[Joey]] + + > > Right. With this simple + > > [patch](http://ettin.org/pub/ikiwiki/hash_setup.patch) it seems to + > > work. However, note that 1) it only allows simple hashes, hashes of + > > hashes will not work (I don't think getops can handle complex hashes + > > anyway); 2) I don't really know when/why you call + > > `possibly_foolish_untaint()`; and 3) I'm no perl guru ;). --Jordà - > > Right. With this simple [patch](http://wiki.ettin.org/files/hash_setup.patch) it seems to work. However, note that 1) it only allows simple hashes, hashes of hashes will not work (I don't think getops can handle complex hashes anyway); 2) I don't really know when/why you call `possibly_foolish_untaint()`; and 3) I'm no perl guru ;). --Jordà + > > > It's good. Applied.. * Wiki links to other translated pages require the full page name including the `.$LANG`. It should be possible to link automatically @@ -61,18 +75,32 @@ to pages with the same `.$LANG`, but that would probably require some changes in IkiWiki. (I'm not sure though, I still haven't looked at it... any hints?) - > Have you considered using the form ll/page? This would let more usual linking rules apply amoung pages without needing to specify the language. I'm not sure if you're supporting browser content negotiation, or whether that other layout would be harder to support it though. --[[Joey]] - - > > Actually, I'm happy with the way it works now (and yeah, it is very easy to take advantage of content negotiation). I just wanted something simple to translatte a single page (or a few pages), not the entire wiki. I'm not even sure it is a good idea to have fully multilingual wikis, in most cases I would go for a different wiki for each language. That said, I think it is an interesting idea, so I'll take a look when I have the time. Thanks for your comments. --Jordà - - -Examples --------- - -* [Linguas](http://wiki.ettin.org/linguas.en.html). A page with the same -content than this one. - -* [Hello in some languages](http://wiki.ettin.org/hello/hello.en.html). The -translations were taken from [Hello in many -languages](http://www.omniglot.com/language/phrases/hello.htm) and from -the [Debian](http://www.debian.org/) website. + > Have you considered using the form ll/page? This would let more usual + > linking rules apply amoung pages without needing to specify the + > language. I'm not sure if you're supporting browser content + > negotiation, or whether that other layout would be harder to support it + > though. --[[Joey]] + + > > Actually, I'm happy with the way it works now (and yeah, it is very + > > easy to take advantage of content negotiation). I just wanted + > > something simple to translatte a single page (or a few pages), not + > > the entire wiki. I'm not even sure it is a good idea to have fully + > > multilingual wikis, in most cases I would go for a different wiki + > > for each language. That said, I think it is an interesting idea, so + > > I'll take a look when I have the time. Thanks for your comments. + > > --Jordà + +* The changes to htmllink in ikiwiki 1.44 broke this plugin. +The following fixes it: + + --- linguas.pm.orig 2006-08-23 19:07:04.000000000 +0200 + +++ linguas.pm 2007-03-24 01:53:18.000000000 +0100 + @@ -100,7 +100,7 @@ + if (exists $linguas{$2} && defined $linguas{$2}) { + $link = $linguas{$2}{'name'}; + } + - push @links, IkiWiki::htmllink($page, $destpage, $trans, 0, 0, $link); + + push @links, IkiWiki::htmllink($page, $destpage, $trans, noimageinline => 0, forcesubpage => 0, linktext => $link); + } + + my $otherlinguas = 'Translations:'; \ No newline at end of file