Hi Baz,

We use a single UTF-8 XML translations file that contains a node for each
language (currently 8 languages, including Russian/cyrillic and
Japanese/kanji translations). The translations XML file is parsed and loaded
into server scope on application startup to ensure that it's accessible to
many applications.

The language handler CFC contains one generic pseudo-getter that accepts a
Language argument ('en', 'fr', 'jp' etc) and an Item ('submit', 'save',
'search results' etc) argument. Having a generic getter means that we only
have to modify the XML file, not the CFC, if we add a new translation -
handy if you're updating your translations on a regular basis, as we do.

Cheers,
Ed

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Baz
Sent: 18 December 2005 06:10
To: [email protected]
Subject: [CFCDev] CFC that reads XML



Hi,

If you were implementing multiple languages and wanted to store all your
text in multiple XML files (English.xml, French.xml, etc.) and each XML file
had a structure like this:

<root>
  <resource name="ContactUs.PageTitle">Contact US</resource>
  <resource name="ContactUs.BodyTitle">Feel free to contact us</resource>
  ...
</root>

Would you create 1 CFC that loads the appropriate language file, and
contains a getter FOR EACH text element (hundreds of getters)? Or would you
make 1 generic getter that takes as an argument the full resource name?

Is this generally a good way to go about implementing multiple languages?

Cheers,
Baz






----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]



________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to