Hello.
I know this topic has been met many times in this forum (and not only English, but in different languages).
August 2008. My question is:
With the current MODx stable version 0.9.6.1p2, which is THE solution for creating and managing a multilingual site?
I mean, a solution that:
- Doesn’t come into conflict with any classical snippet, etc.
- Uses cookies so that "the system" is able to "remember" your preferred language.
- When you jump from any page to another language (by clicking a link with the name of the language), you are redirected to the same page (NOT THE HOME PAGE) but shown in the language you have just chosen. If such a page doesn’t exist (the translation isn’t ready yet, or simply there is not correspondence for the former page), it can be rendered in another language, or a standard message can be shown instead...
If you think I should read the forum carefully, please, tell me, but also tell me which is, in your experience, the definite solution, so far.
Thank you!
GinerBosk
If you can dream it, you can do it.
I don’t know that there is one best solution for creating multilingual sites. There are some trade-offs to be made among the different techniques, and which method you prefer may depend upon what’s most important to you. I’ve only done bilingual sites so far, but I’ve been happy with my method for creating those.
Basically I create a subfolder in the document tree for each language (actually I create the whole site in one language first and then just duplicate that folder so that I don’t have to manually recreate all the pages). I use a TV called otherLanguageDocumentID to store the docID of the page in the other language, and I create links directly to those other pages using this TV (for multi-lingual sites you could have several TVs). This is probably the biggest inconvenience I’ve found in using my method: You need to manually enter the docID for the translated pages.
I have a snippet in each language’s template that displays content if there is any and if not displays a message explaining that the page isn’t available in that language and grabs the content from the otherLanguageDocumentID instead (all pages on our sites exist in English, so this is easy). I use a plugin to forward people who use the Spanish domain name (with no specific page) to the Spanish home page and to set a cookie for language preference (I’ve posted this code in the forums before; it’s based on someone else’s solution). I haven’t had much trouble with the standard snippets working with this method (e.g., Ditto, WayFinder, AjaxSearch).
And I think that’s it. It works fine for me, and I like it better than the other methods I’ve tried or seen described. Personally I prefer to have separate pages for different languages instead of loading language content from TVs, and doing so makes sure that everything is indexed as expected by other standard snippets.
I use the one container for each language solution as well, but it fails when you have single files that are shared between two languages. I have used a cookie/session based solution for this but it is not ideal. And having single documents with TVs for each language is no good for seo since all the languages will have the same urls which will confuse the search engines and most likely only one language will be crawled.
Oh I forgot that I also make my 404 page bilingual (error message in both languages with links to search, etc.), since some people might get that without ever having set a language cookie.
I think, thererfor I am! But what I am, and why...?