Loading...
 
Multilingual/i18n

Multilingual/i18n


Links to translated wiki pages

posts: 138

The content of my web page is implemented as a wiki. Originally all pages were in English, now some are also available in German.

For those pages which are translated, I would like links to the pages to automatically select the correct language. There are two common cases:

  • direct links in menus
  • links in other pages.


In fact, I thought that once a page was defined as a translation of another page, then this would happen automatically, but this is not the case for my tikiwiki.

(Sorry if I am asking something which is described clearly in the online documentation, but this appears to be offline at present).

Phil

posts: 1817 Catalan Countries

Hi Phil:

Luckily, doc.tw.o is back online :-)

Mmmm, once you create the translation of a page, it's added to the "translation set" of your choice, and after that, links appear automatically in a dropdown menu on top of each page of that translation set.

See the demo at:
http://wiki-translation.com/CLWE+Demo

After that, if you can help to improve the written Documentation to include the answer to this question/doubt you have/had, it will be very welcome.

HTH

posts: 138

Hi Xavi,

On the site http://www.wiki-translation.com I found an example of what I want to achieve.

On the page http://www.wiki-translation.com/tiki-index.php there is a link with the text
Cross-Language Collaboration Workshop in September: Babel Wiki 08
and the target http://www.wiki-translation.com/tiki-index.php?page=BabelWiki08&bl=y.

On the french version of the same page http://www.wiki-translation.com/tiki-index.php?page=Bienvenue+%C3%A0+Wiki-Translation there is an identical link (not translated!).

Since the target page is available in both French and English, it would be nice if the link automatically opened the wiki page in the same language. The important thing for me, is that I don't want to have to modify the links in the wiki source.

Does it work?

I was going to say, that it works just as I want it to. In fact with FireFox it seems to work perfectly. The link on the French page opens the French version of the target page. Unfortunately, it doesn't seem to work with Internet Explorer or Opera.

With Firefox, I have the Quick Locale Switcher Add-On installed, which may modify the behaviour. However, I did not explicitly change the user-interface language to French.

Apart from links in wiki pages, it is important for me that menu links open the appropriate versions of wiki pages.

Thanks in advance for any help. I will be digging into the documentation in the next few days.
Phil

posts: 138

I have made a fix to tiki-index.php.

At around line 74, the variable $use_best_language is set, based on the setting feature_best_language. However, this logic is only performed, if no wiki page is specified.

I have moved this logic down two lines, so that it is outside the if block which selects the HomePage if no other page is specified.

This has fixed the behaviour for me. If I can get commit access to the SVN archive, I will commit the change.

Phil

posts: 138

I turns out that my solution was not quite perfect. In fact it broke the language selection via the drop down list.

For now I have fixed this by adding a hidden input field to the language selection form in translated-lang.tpl:

Copy to clipboard
<input type="hidden" name="nobestlanguage" value="1">

If this parameter is present, then I supress setting $use_best_language=true in tiki-index.php.

This is reasonably close to the behaviour that I want, though it might be better to persist the language selection (in a cookie?) when the user has specifically made it.

Phil