Languages

21 posts by 8 authors in: Forums > CMS Builder
Last Post: September 7, 2011   (RSS)

By danwilson - September 7, 2011

Hi,
I created a site last year that we later modified to be multi-lingual (English and Spanish). It works pretty well (the site is http://www.calloan916.com). Here's how I did it:

I created two pages whose sole function was to set a cookie "language" to a value of either English or Spanish (English being the default language). Clicking on a link in the header takes a user to the cookie-setting page, sets the cookie, and immediately takes them back to the page the user was on.

Then, in CMSB, I did exactly what Jason mentions as the first solution - I added duplicate fields in the database for the record Name (or Title), TITLE Tag, META Description, and Content (by appending their labels and record names with "_SP"). On the viewer pages, I used conditional rules to check for the existence of a language cookie, and write the appropriate data fields to the page.

The trickiest part were the menus. Since my client only wanted to pay to have the most important pages translated, about 35-30% of the site is available in English only. To avoid serving blank pages to Spanish-language visitors, I modified the script that writes the menu hierarchy so that it only returned results where there was data in the "TITLE_SP" field. So if there is no Spanish title in the database, that page doesn't get included in the top menu.

Hope this helps somebody else!
-Dan