A small demo you can find in
http://www.mindreamz.net/modx091/ but I would like the MODx-gurus to look at my code to know if I used the right functions in the right places (going into the core code to find out which function to use is not a great thing, maybe sometimes I used a deprecated function or something like this)
The goal was to provide a multi-language-content site, in which the user can choose a preferred language and browse the site reading pages in that language if they are available, and been redirected to a "default language page" if not.
My solution is the following:
1) there is a $_SESSION variable that stores the preferred language choice of the user;
2) I modified the *_site_content table adding two fields:
- contentLang, that stores something like "en", "it", "fr", ...
- refId, the id of the page in the default language which this one is a translation
3) I added a snippet to show the language flags for the user choice
4) I added a plug-in that redirects to the right-language page
5) I modified the DropMenu to show only the chosen language entries
6) I modified the manager in these ways:
- in the document tree, each page has next to it its current translations (you can click on them and go to the translation, without the need to have a different tree for each language and to have not every page translated)
- while vieweing a document, you can also see in which language is the content and you have a button that duplicates the page to begin to translate it
- in the settings page you have to write which languages your site is in and the default language
The only thing that is to be implemented is a plug-in that rebuilds the tree accordingly after the insertion of a new translation (it is needed and you can easily figure out why)
Now, then, how can I show my solution? I can give to someone the access to my manager, in order to see my modifies. Or... what else?