Hi Anthony,
why don't you use one file for the definition of the texts in the
different languages (or maybe the database as we do) and use only one
directory with your app files?
then you do something like this:
<cfinclude template="act_setlangtexts.cfm">
English Page (index.cfm)
<cfoutput>
<p>#stLang.Page1.Introduction#</p>
<p><a href="#CGI.SCRIPT_NAME#?lid=#stLang.OtherPageLangId#">Go to
#stLang.otherLanguage# Version</a></p>
<cfoutput>
And in the file act_setlangtexts.cfm you do something like this:
<cfset stLang = StructNew()>
<cfset stLang.Page1 = StructNew()>
<cfif url.lid eq 2><!--- means french --->
<cfset OtherPageLangId = 1>
<cfset otherLanguage = "English">
<cfset stLang.Page1.Introduction = "This is the french version">
<cfelse>
<cfset stLang.OtherPageLangId = 2>
<cfset stLang.otherLanguage = "French">
<cfset stLang.Page1.Introduction = "This is the english version">
</cfif>
This implementation has at least two advantages.
1. You only have one file (or one database) where you have all your
texts, so it's easier to translate
2. you don't have to change a bug in more than one file
3. It's easier to implement a new, third language as well (almost no
change of code necessary)
Regards
Gert Franz
Customer Care
[EMAIL PROTECTED]
www.railo.ch
Join our Mailing List / Treten Sie unserer Mailingliste bei:
deutsch: http://de.groups.yahoo.com/group/railo/
english: http://groups.yahoo.com/group/railo_talk/
Anthony Crawford schrieb:
> Hi guys, just wanted to pick your brains before I implement this.
> I have been asked to add French to an already English website. What I
> suggested was to copy the English files to another directory called "French".
> I can switch between languages by adding a bit of code in the French /
> English hyperlink.
> Just wish to confirm whether this is a good method... :) Thanks
>
> In this example, I am swithing between English and French pages.
>
> English Page (English/index.cfm)
> <p>This is the English version.</p>
> <p><a href="<cfoutput>#ReplaceNoCase(CGI.SCRIPT_NAME, "english",
> "french")#<cfoutput>">Go to French Version</a></p>
>
> French Page (French/index.cfm)
> <p>This is the French version.</p>
> <p><a href="<cfoutput>#ReplaceNoCase(CGI.SCRIPT_NAME, "french",
> "english")#</cfoutput>">Go to English Version</a></p>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251003
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4