A couple of days ago I mentioned that the download for LWWCM was pretty big because of all the language templates, I also mentioned that it was a pity that all the languages weren’t combined into a single template kind of like how the Domino Language Packs are done. Now I know why they are seperate…
With LWWCM you can create multiple publication databases, each from different language templates and then using a single control database you can tie them together so that when a new document is created in one publication database it can automatically be copied into the other language databases for translation. This means that you can easily create a multi language site that you know is going to have the same content in each language. The page name will be the same so the only difference between the two sites is the name of the database in the URL. It is also nicer for the users who need to enter the content as then can use the publication database that is specifically for their language.
So, with multiple languages for your site wouldn’t it be nice to give the users a way of switching between the languages. When using the multilanguage features of LWWCM the pagename is always the same between the different publication databases. The only different from the users perspective is the URL will reference a different NSF file.
Armed with this information you can then write a very simple bit of javascript to switch between languages that will always leave you on the same page in the other language. All you need to do is grab the current url from the document object model. In the URL find the name of the current database that you are in and replace it with the name of the database that holds the other language, for example …blah.com/EN.nsf/Content/SomePage would become …blah.com/DE.nsd/content/SomePage. The page reloads in the other language but at the same place.
Now, what would be nice is a homepage that detects what language you were using last time. You could possibilly do this with LWWCM also. By setting a cookie when the user switches language you could check this same cookie when the page loads. If the language of the page does not match the cookie then just change the url and load in the correct language.
You must be logged in to post a comment.