Well, I managed to do this for 1 page, however if I want the same snippet to work for ALL pages, I still run into problems.
The wiki documentation provides an example for 1 page, and then states:
"For each page on your site you need to specify which is the translated page. This is achieved using the languages template variable. The format of the template variable value is:
two_letter_iso_country_code=document_id,two_letter_iso_country_code=document_id "
and a bit futher
"To add more languages:
1. Duplicate all site pages in the new language
2. Add the new flag icon to assets/images
3. Add the new language to the array in the Languages snippet
4. Edit existing pages to specify where the new translated page is, using the languages template variable
For a menu system, use the Wayfinder snippet with the following call:
[!Wayfinder? &startId=`[[UltimateParent]]`!]
and each webpage always lists the menu from the top folder of each language.. "
This is not clear enough (to me as a noob at least!). Mind you, I do appreciate the snippets provided!
Is the basic functionality of this snippet to provide multi language support for only ONE page, or should it work across the whole site?
I am "guessing" I need to set the TV languages to e.g.
TV "Languages":
en=2,de=3,en=5,de=6,en=8,de=9
meaning that the German version of pageid 2 is pageid 3, English page 5 is German page 6, English page 8 is German page 9 etc. etc.
Evaluating the TV, in this case this will result in 6 links (and their flags) in the sidebar, as the TV languages is processed for each entry, something like this (not actual code):
Result from Snippet "Languages":
<a href="page-2" img src="en.gif">
<a href="page-3" img src="de.gif">
<a href="page-5" img src="en.gif">
<a href="page-6" img src="de.gif">
<a href="page-8" img src="en.gif">
<a href="page-9" img src="de.gif">
This is obviously not what I want, I guess the TV "languages" should be global as far is the number of languages and flags w/links is concerned, yet "per page" for each translated page.
Also not clearly documented is how the document structure should be for multiple pages, say I have a page "Home", an page "About" and a page "Products". Each should be in both English and German
I am "guessing" again:
"root"
pageID 1 (Home - redirects to default language "en", page 2)
pageID 4 (About - redirects to default language "en", page 5????)
pageID 7 (Contact - redirects to default language "en", page 8????)
¦
+--en
¦ +--PageID2 (Home in en)
¦ ¦
¦ +--PageID5 (About in en)
¦ ¦
¦ +--PageID8 (Contact in en)
¦
+--de
¦ +--PageID3 (Home in de)
¦ ¦
¦ +--PageID6 (About in de)
¦ ¦
¦ +--PageID9 (Contact in de)
¦
And on top of that, some more questions:
- How to get the top menu multi language? Is that included?
- Will the redirects take into account the previously selected language, e.g. user starts from (deafult) English Home page (ID 1), then selects German Home (ID 3), navigates to About (ID 4), will that redirect to ID 5 (Default English, according to the redirect in the "root" page,
or to ID 6, German according to the TV and the previously selected language)?
- what about "latest news" or "blog entries" flashes in the sidebar?
Anyway, I think the concept is fine, but could be better explained (again, maybe just for a noob!) by simply adding an example for more than 1 page.
But again, I really appreciate all the work that’s been done, I am trying to implement this, but feel that I should either better understand it, or write my own snippet, probably having 1 TV for the available languages (2 in this case), and 1 TV for the redirects (with 3 entries in this case). It is vital that I can implement this in an easy way.
Thanks for your comments, and apologies for my ignorance and being a pain ;-)
Ronald