I have same issue at hand and here's some initial plans I have for same
thing.
Actually I'm pretty close to what Erki already had in mind. If there is
some obivious
problems I'd like to hear about it..
-----
How website translation should be implemented?
Translation is based on XML file that has all information that
is required to translate site to different languages. Because we use
XML it's possible to later add languages to this file or add new items
to it - and it doesn't have to be done simultaneously with site update
because
application can easily pick correct pieces of information from any version.
XML format is also safe if there is need to use different platform in the
future because every possible platform supports XML.
1. example of actual dictionary in XML format
<?xml version="1.0" encoding="UTF-8"?>
<dictionary>
<text>
<contact eng="contact"
swe="kontakt"
fin="yhteys"/>
<home eng="home"
swe="start"
fin="etusivu"/>
</text>
<images>
<contact eng="contact" eng_img="eng_contact.gif"
swe="kontakt" swe_img="swe_contact.gif"
fin="yhteys" fin_img="fin_contact.gif"/>
</images>
</dictionary>
2. Dictionary is processed once (when server is restarted) or when it's
modified into memory using ColdFusion structures for simple and efficient
data access.
3. During each request selected language structure is copied to Request
scope.
This is fast because it's simply memory copy.
4. When site is displayed all translated items are displayed using
pre-prosessed
dictionary structure. Same principle is used with images where both textual
alternative
and image file has to be specified.
<CFOUTPUT>#Request.dict.home#</CFOUTPUT>
<CFOUTPUT><IMG SRC="#Request.image.home.src#"
ALT="#Request.image.home.alt#"></CFOUTPUT>
5. Larger but static text block are stored as separate files and
conditionally included
in fusebox switch-block:
<CFCASE VALUE="information">
<CFSWITCH EXPRESSION="Request.language">
<CFCASE value="eng">
<CFINCLUDE TEMPLATE="dsp_eng_information.cfm">
</CFCASE>
<CFCASE value="swe">
<CFINCLUDE TEMPLATE="dsp_swe_information.cfm">
</CFCASE>
<CFCASE value="fin">
<CFINCLUDE TEMPLATE="dsp_fin_information.cfm">
</CFCASE>
</CFSWITCH>
</CFCASE>
6. Database will be designed to store information for languages that each
entity
can fullfill. There are cases where it's better to have atlest some language
available
for user instead of no information.
7. Web interface for modifying XML dictionary is created but larger
modifications
can be implemented using separate text editor (this is essential if
translation agency
is used). Actual XML data is stored into database making it possible to
return or refer also
old versions.
==^================================================================
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]
T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================