Multi-lingual support?

Hi all,

We’re looking into a project that requires multi-lingual content (in this case English and Mandarin ,where the user determines what language they want to view the site in) and are considering using FC7 as the base CMS for the site.

Doing a bit of digging as to what kind of approaches others might have taken in similar cases hasn’t really turned up much apart from some forum comments way back in 2003 (!)

Has anyone tackled a single-project, multi-lingual site and can offer any insights as to their approach? At the moment, we’re just spit-balling the idea around to see what we can come up with.

Dave

Hi, Dave.
My company has done a few multi-language sites before. We just did a 3 language (EN, ES, and PT) site and Farcry worked great for the content side of things. We set up multiple fields for each content-type and created our own “i18n” file of sorts for non-CMS elements.

In FarCry, we added in duplicates for any field that required it. So for say a news object, we had 3 title fields, Title, TitleES, and TitlePT. Then Body, BodyES, BodyPT etc…

We made sure to name them this way so we could leverage the “Eval” function to output based on the language code if it was not English.

Evaluate("stobj.title#langvar#") rendered as Title, TitleES, and TitlePT based on language.

This allowed us to write a single line instead of a switch or if statement.

Then for any items that were not managed in the CMS, like button text etc. We set up an include that housed all our needed language translations in a switch function.

translate("action_next", langvar)

<cffunction name="translate">
  <cfargument name="message" required="yes" type="string">
  <cfargument name="lang" required="yes" type="string">
  
  <cfswitch expression="#message#"> 
    <cfcase value="action_next">
      <cfif lang EQ 'EN'><cfset message="Next"></cfif>
      <cfif lang EQ 'ES'><cfset message="Siguiente"></cfif>
      <cfif lang EQ 'PT'><cfset message="Seguinte"></cfif>
    </cfcase>

    <cfdefaultcase> 
      <cfset message="undefined"> 
    </cfdefaultcase>
  </cfswitch> 
  <cfreturn message>
</cffunction>

For URLs, you will need to write your own function to save when something is published, and then render out the proper URL language string for links. This is really the only tricky part.