There are a few threads on this topic, but since our approach is a tiny bit different, we thought we would share it with the community for comment.
Our project is a bilingual Spanish and American-English site. We’re using EE as a Content Management System (CMS).
In the Admin section of the site, we added custom site fields for the Spanish entry titles and for the Spanish content right below the English ‘title’ and ‘body’ fields. {esponoltitle} and {espanolbody}
Our bilingual web ‘content-master’ enters all content in both languages in each entry. The Spanish and English is right next to each other in each entry for easy editing.
We then created two templates, one called index and one called indice (English/Spanish).
Each template displays one language. In the example below, the weblog:entries tag displays only the Spanish content.
{exp:weblog:entries weblog=“MySite”}
<div class=“title”>{espanoltitle}</div>
<div class=“maintext”>{espanolbody}</div>
{/exp:weblog:entries}
Then to keep administration simple (that is a major goal of this project), we are using the Category Management system built into EE here; [Control Panel Home › Admin › Category Groups] to organization the site’s content. Each category/subcatagory represents a traditional static web page.
We use the weblog:categories tag to manage the language templates for us. In the example below, pay close attention to the {path=myweblog/indice} and notice that we’ve told EE to create links that call our Spanish template (called ‘indice’). In the English template, we’ve told EE to create links that call the English template by using this: {path=myweblog/index}
{exp:weblog:categories weblog=“MySite” style=“nested”}
<a href=”{path=myweblog/indice}”>{category_name}</a>
{/exp:weblog:categories}
We’re using that great java Chris introduced/used in the EE Knowledge base FAQ to created fully dynamic expanding category headings and subcategory links from the nested category tag above. We used CMS to make it display a little less techie.
The site visitor may change language on any page of the site by clicking a special link that exchanges one template for the other. All the site’s page links dynamically adjust to include the alternate template also. Also the visitor remains on the same page and entry even when they toggle between languages. Example tag:
{exp:weblog:entries limit=“1”}
<a href=”{entry_id_path=weblog/template}”>English</a>
{/exp:weblog:entries}
Each of our category groups are titled in both languages; Contact/Contactarnos so if we ever need to add, move or delete a category (think web page) we just change it in the Category Groups area and our page links, are dynamically adjusted in both language templates; no need to update the links at all.
We think this is a very simple and easy to maintain method for a bilingual CMS. Thanks to Rick and his team for giving us these great tools to work with.
The site is still in development, but will go live within a few weeks. I’ll post an update at that time so folks can see it in action.
