Bruce,

I have a client site that  provides online learning internationally  
with clients from different countries and Languages such as Japanese,  
Arabic, French, Spanish and more.  The same core model layer serves  
the international portal, US portal, and allows for translation of  
the entire site text into any language.

Here's some of the basics:

On session start a setLanguage() function is run which does the  
following:

1) Sets the language locale variable which is cross referenced to the  
#server.coldfusion.supportedlocales#.  This allows you to use  
Coldfusion internationalization for dates/currency formatting.

2) Sets a language prefix like "en" or "jp" based on the locale  
setting.  This is used to serve different javascript or help files as  
necessary   (i.e. - "/js/common.en.js" or "/js/common.jp.js");

3) If the language isn't currently in use, it creates the cache  
structure to store the language data.    I've used structures and  
arrays for the container in the Application scope which pulls the  
cached strings, but ultimately settled on a Query object and use QoQ  
to pull from the cache. The reason for the QoQ is case sensitivity.    
Even though there's a bit more overhead, if the site is any size, you  
will inevitably find yourself translating the same string in  
different ways for presentation purposes.

A translate() function is scoped to the request which allows site- 
wide access the function.  Translation content is pulled from the  
database (or XML) and the result is cached in the query object which  
is used on subsequent requests for the same string.    Since this  
particular site has around 50 different international sites pointing  
to it, there is also a function which runs and clears the cached  
languages after an interval in case there are cached languages taking  
up memory which are not being actively used.

Lastly, since the content is always changing, the translation  
function also creates a string in "draft" status when it encounters  
text that hasn't yet been translated.  It then caches and returns the  
original string in order to skip evaluation for future requests.  The  
client can then edit the draft translations at their convenience and  
flush the cache when they publish the string live.

HTH,

Jon

On May 9, 2007, at 8:23 AM, Bruce Sorge wrote:

> I have a new site I am working on that is going to be multi-lingual  
> (Spanish
> and English). Has anyone done this before and if so, what are some  
> best
> approaches? It is of course database driven, and it is a model (not  
> nude)
> site. What are some of the challenges I may face?
>
>
>
> Thanks,
>
>
>
> Bruce


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277427
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to