Try this as well.
http://www.devx.com/xml/articles/kc1100/cox01-1.asp
We took this idea and loaded the XML file into an application variable after
de-serializing it with a cfwddx call.
Sample of the XML file.
<wddxPacket version="1.0">
<header />
<data>
<struct>
<var name="1LANG">
<string>English|Spanish</string>
</var>
<var name="1LANGCODE">
<string>en|es</string>
</var>
<var name="2NDDOWNLOAD">
<string>2nd Download Fee:|Costo de la
Segunda Descarga:</string>
</var>
<var name="ZOOMSETTINGS">
<string>Zoom Settings|Ajustes del
Zoom</string>
</var>
</struct>
</data>
</wddxPacket>
<cfif NOT isdefined("application.translate") OR attributes.readXML EQ
true>
<!--- read xml file --->
<cffile action="READ" file="#attributes.xmlfile#"
variable="wddxpacket">
<!--- de-serialize xml into application variable --->
<cfwddx action="WDDX2CFML" input="#wddxpacket#"
output="application.translate">
<cfset attributes.readXML = false>
</cfif>
Then we use this to get the correct language out. Client.langid is the
numeric position in the list where the correct text is at. It is defined as
being the index of the language ID in the 1LANGCODE element of the table.
<cfoutput>#listgetat(application.translate["2NDDOWNLOAD"],Int(client.langid)
,"|")#</cfoutput>
We support English, German, Spanish and Italian at the moment. Clearly we
also wrote a nice application that displays the whole table and lets us edit
it simply.
One of these days I am going to replace all of the LISTGETAT stuff with a
UDF that will guarantee that if the translated text doesn't exist we will at
least get the English back.
For any graphics we have different image subdirectories with those there.
images_en, images_es ... The path is set in the app_globals (We use FuseBox
2.0) like this:
<cfset attributes.imagespath = "/images_#client.langcode#">
Finally we check the language of the browser and default to the correct one
if it is supported otherwise we use English. We have links on the site that
let the user change the language and we store that as a client variable so
we know the next time they come back what language they wanted. It is also
stored in the database so if they log in from a new machine we can give them
the correct language.
Shawn McKee
Manager, Web Development
NewsStand, Inc.
8620 Burnet Rd., Suite 100
Austin, TX 78757 USA
512-334-5100
Read newspapers and magazines from around the world in a whole new way.
NewsStand delivers them to your PC without paper and without delay!
Try: http://www.newsstand.com?NSEMC=EMNSI000001
-----Original Message-----
From: Jaime Bonilla [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 2:09 PM
To: CF-Talk
Subject: RE: Bilingual App HELP!!
Hi snifflebear!
You will need to use some sort of "Content Management" type of framework
where the content of your site is store in a database. This way you can
translate all of the information and then display it in templates according
to the user's preference.
Rather than give you a lengthy explanation of what I have done with
something similar I leave you my email so that you can contact me directly
if you really are interested in hearing my 2 cents. Feel free to email me
at [EMAIL PROTECTED]
Jaime
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 1:47 PM
To: CF-Talk
Subject: Bilingual App HELP!!
Hey guys, any of yall Familiar with the Houston International
Festival? Well it's like this festival that features music, dance,
arts, and spotlights a different country every year. Well this year
that country is MEXICO.
And they want to have an English and Spanish version. I would like
some ideas on methods on approaching this. Everything will be
identical. Layout, grpahics. The only difference is the langage
(and of course, text on the navigation buttons will change too). But
i was wondering if there are any veterans :)
Ideally, I would like to have only one copy, instead of an English
copy and a Spanish copy. That way they use the same CFM code. A
bulk of the site would be text and information. So i was thinking
maybe I can just set the text to variables, and display the correct
language depending on their preference. Just text only though!
There will be only one HTML code, and only one CFM code to follow.
So well, there you go! I appreciate any input, humour, pity :)
snifflebear
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists