>- see footer for list info -<
Shawn,

As per my previous replies, I said you need to check the code that renders the 
pages and make sure you are using the request variable which will of course 
contain the correct value to decide we
hat language to use. 
The code you are showing so far does nothing more than set variables, so anyone 
reading cannot really know what you do with those variables and how you use 
them.

Russ
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shawn Fawcett
Sent: 06 June 2008 19:47
To: Coldfusion Development
Subject: Re: [CF-Dev] setting language problem

>- see footer for list info -<
OK, I've simplified it to try to narrow down the problem and I'm pretty 
sure I see the problem. The cookie is actually set but the new variable 
for the cookie is only load after I do a manual reload (F5).
What could I do so the new variable for the cookie is taken into account?
Shawn


<cfset query_string = ReplaceNoCase(query_string,'language=english','')>
<cfset query_string = ReplaceNoCase(query_string,'language=french','')>

<cfparam name="request.language" default="french">

<cfif isdefined('request.language')>

<cfset request.language= language>
<cfset cookie.language = request.language>

<cfelseif isdefined('cookie.language')>
<cfset request.language= cookie.language>

</cfif>


Shawn Fawcett wrote:
>> - see footer for list info -<
> On the bottom of the test page I can see
>
> *Cookie Variables:*
> CFADMIN_LASTPAGE=/CFIDE/administrator/datasources/index.cfm
> CFID=1401
> CFTOKEN=52656740
> LANGUAGE=english
> __utma=96992031.1811583285.1212651992.1212651992.1212651992.1
> __utmz=96992031.1212651992.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) 
>
>
>
> Do this mean that there is a cookie though? Never thought of that.
>
> Snake wrote:
>>> - see footer for list info -<
>>>     
>> Does the cookie exist?
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On Behalf Of Shawn Fawcett
>> Sent: 06 June 2008 01:43
>> To: Coldfusion Development
>> Subject: Re: [CF-Dev] setting language problem
>>
>>  
>>> - see footer for list info -<
>>>     
>> The language switching is working now. But when I strip the url of 
>> the language request it doesn't seem to recognise the cookie and goes 
>> straight to the condition <cfelseif server_name is 
>> "www.111translations.com">
>>
>> Shawn
>>
>> <!--- set the default language or change the language when selected --->
>>
>> <!--- remove language from querystring --->
>> <cfset query_string = ReplaceNoCase(query_string,'language=english','')>
>> <cfset query_string = ReplaceNoCase(query_string,'language=french','')>
>>
>> <cfif isdefined('URL.language')>
>>     <!--- if language is set by a link set request var and cookie to 
>> that language --->
>>     <cfset request.language=URL.language>
>>     <cfset cookie.language = url.language>
>> <cfelseif isdefined('cookie.language')>
>>     <!--- otherwise if cookie exists, use its value --->
>>     <cfset request.language=cookie.language>
>>
>> <cfelseif server_name is "www.111translations.com">
>> <!--- do you really need this ? yep, I have three domains for 3 
>> different countries. Will add later. --->
>> <cfset request.language="english">
>>
>> <cfelse>
>> <cfparam name="request.language" default="french">
>> </cfif>
>>
>> Snake wrote:
>>  
>>>> - see footer for list info -<
>>>>           
>>> Here is how I think it should be based on what u have shown, but I 
>>> think you should also be looking at the code that uses the 
>>> request.language variable, just setting them will not do anything by 
>>> itself if nothing is using it.
>>>
>>> <cfparam name="request.language" default="french">
>>> <!--- remove language from querystring --->
>>> <cfset query_string = 
>>> ReplaceNoCase(query_string,'language=english','')>
>>> <cfset query_string = ReplaceNoCase(query_string,'language=french','')>
>>>
>>> <cfif server_name is "www.111translations.com">
>>> <!--- do you really need this ? --->
>>> <cfset request.language="english">
>>> </cfif>
>>>
>>> <cfif isdefined('URL.language')>
>>>     <!--- if language is set by a link set request var and cookie to 
>>> that language --->
>>>       <cfset request.language=URL.language>
>>>     <cfset cookie.language = url.language>
>>> <cfelseif isdefined('cookie.language')>
>>>     <!--- otherwise if cookie exists, use its value --->
>>>     <cfset request.language=cookie.language>
>>> </cfif>
>>>
>>>
>>> Russ
>>>
>>> -----Original Message-----
>>> From: [EMAIL PROTECTED] 
>>> [mailto:[EMAIL PROTECTED] On Behalf Of Shawn Fawcett
>>> Sent: 06 June 2008 00:21
>>> To: Coldfusion Development
>>> Subject: Re: [CF-Dev] setting language problem
>>>
>>>      
>>>> - see footer for list info -<
>>>>           
>>> I'm hurtin' here. Something still really wrong.
>>>
>>> <cfif isdefined('request.language')>
>>> <cfset query_string = 
>>> ReplaceNoCase(query_string,'language=english','')>
>>> <cfset query_string = ReplaceNoCase(query_string,'language=french','')>
>>>
>>> <cfelseif server_name is "www.111translations.com">
>>> <cfparam name="request.language" default="english">
>>>
>>> <cfelseif isdefined('cookie.language')>
>>> <cfset request.language = cookie.language>
>>>
>>> <cfelse>
>>> <cfparam name="request.language" default="french">
>>> </cfif>
>>>
>>> <cfif isdefined('URL.language')>
>>>       <cfset cookie.language=URL.language>
>>>       <cfset query_string = 
>>> ReplaceNoCase(query_string,'language=english','')>
>>>       <cfset query_string = 
>>> ReplaceNoCase(query_string,'language=french','')>
>>> </cfif>
>>>
>>>
>>>
>>>
>>> Snake wrote:
>>>      
>>>>> - see footer for list info -<
>>>>>                   
>>>> Well firstly I will point out that u get an error on the page as 
>>>> cookie.english does not exist
>>>> Which is probably because this bit of code doesn't make sense
>>>>
>>>> <cfelseif server_name is "www.111translations.com 
>>>> <http://www.111translations.com>">
>>>> <cfset request.language = cookie.english>
>>>> <cfparam name="request.language" default="english">
>>>> <cfelse>
>>>> <cfset request.language = cookie.french>
>>>> <cfparam name="request.language" default="french">
>>>> </cfif>
>>>>
>>>> Surely it should be
>>>>
>>>> <cfelseif server_name is "www.111translations.com">
>>>> <cfparam name="request.language" default="english">
>>>> <cfelse>
>>>> <cfparam name="request.language" default="french">
>>>> </cfif>
>>>>
>>>> But request.language wont be set by a cfparam if it already exists.
>>>>
>>>> I would suspect that your page is not changing because it relies on 
>>>> the cookie, which hasn't been set until after the language has been 
>>>> set and the page has been reloaded. So you need to set and use the 
>>>> request variable first so that it is applied before you render the 
>>>> page, then assign it to the cookie.
>>>>
>>>> Russ
>>>>
>>>> -----Original Message-----
>>>> From: [EMAIL PROTECTED] 
>>>> [mailto:[EMAIL PROTECTED] On Behalf Of Shawn Fawcett
>>>> Sent: 05 June 2008 23:24
>>>> To: Coldfusion Development
>>>> Subject: [CF-Dev] setting language problem
>>>>
>>>>            
>>>>> - see footer for list info -<
>>>>>                   
>>>> I'm having trouble getting the right behavior when setting the 
>>>> language in our site.
>>>>
>>>> on the index.cfm page I have a choice between english and french 
>>>> (upper right). When I click on it, it seems to request the language 
>>>> but the language only changes when I click again or refresh the page.
>>>>
>>>> the code behind the language links is:
>>>> <cfoutput> <cfif request.language is "french">
>>>>       <p><a href="#script_name#?#query_string#&language=english" 
>>>>  >English</a><br />
>>>>     <a href="#script_name#?#query_string#&language=french" 
>>>> class="active">Fran&ccedil;ais</font></a></p>
>>>>  <cfelse>
>>>>       <p><a href="#script_name#?#query_string#&language=english" 
>>>> class="active">English</a><br />
>>>>     <a 
>>>> href="#script_name#?#query_string#&language=french">Fran&ccedil;ais</font></a></p>
>>>>  
>>>>
>>>>  </cfif> </cfoutput>
>>>>
>>>> I have a seperate file act_setlanguage.cfm:
>>>> <!--- set the default language or change the language when selected 
>>>> --->
>>>> <cfif isdefined('cookie.language')>
>>>> <cfset request.language = cookie.language>
>>>>
>>>> <cfelseif server_name is "www.111translations.com 
>>>> <http://www.111translations.com>">
>>>> <cfset request.language = cookie.english>
>>>> <cfparam name="request.language" default="english">
>>>> <cfelse>
>>>> <cfset request.language = cookie.french>
>>>> <cfparam name="request.language" default="french">
>>>> </cfif>
>>>>
>>>> <cfif isdefined('URL.language')>
>>>>       <cfset cookie.language=URL.language>
>>>>       <cfset query_string = 
>>>> ReplaceNoCase(query_string,'language=english','')>
>>>>       <cfset query_string = 
>>>> ReplaceNoCase(query_string,'language=french','')>
>>>> </cfif>
>>>>
>>>> the testing site is here: www.111translations.com 
>>>> <http://www.111translations.com>
>>>>
>>>> cheers,
>>>> Shawn
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>>
>>>> For details on ALL mailing lists and for joining or leaving lists, 
>>>> go to http://list.cfdeveloper.co.uk/mailman/listinfo
>>>>
>>>> -- 
>>>> CFDeveloper Sponsors:-
>>>>            
>>>>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>>>> - Lists hosted by www.Gradwell.com -<
>>>>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>>>>> help -<
>>>>>                   
>>>> _______________________________________________
>>>>
>>>> For details on ALL mailing lists and for joining or leaving lists, 
>>>> go to http://list.cfdeveloper.co.uk/mailman/listinfo
>>>>
>>>> -- 
>>>> CFDeveloper Sponsors:-
>>>>            
>>>>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>>>> - Lists hosted by www.Gradwell.com -<
>>>>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>>>>> help -<
>>>>>                   
>>> _______________________________________________
>>>
>>> For details on ALL mailing lists and for joining or leaving lists, 
>>> go to http://list.cfdeveloper.co.uk/mailman/listinfo
>>>
>>> -- 
>>> CFDeveloper Sponsors:-
>>>      
>>>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>>> - Lists hosted by www.Gradwell.com -<
>>>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>>>> help -<
>>>>           
>>> _______________________________________________
>>>
>>> For details on ALL mailing lists and for joining or leaving lists, 
>>> go to http://list.cfdeveloper.co.uk/mailman/listinfo
>>>
>>> -- 
>>> CFDeveloper Sponsors:-
>>>      
>>>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>>> - Lists hosted by www.Gradwell.com -<
>>>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>>>> help -<
>>>>           
>>
>>
>> _______________________________________________
>>
>> For details on ALL mailing lists and for joining or leaving lists, go 
>> to http://list.cfdeveloper.co.uk/mailman/listinfo
>>
>> -- 
>> CFDeveloper Sponsors:-
>>  
>>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>> - Lists hosted by www.Gradwell.com -<
>>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>>> help -<
>>>     
>>
>>
>>
>> _______________________________________________
>>
>> For details on ALL mailing lists and for joining or leaving lists, go 
>> to http://list.cfdeveloper.co.uk/mailman/listinfo
>>
>> -- 
>> CFDeveloper Sponsors:-
>>  
>>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>> - Lists hosted by www.Gradwell.com -<
>>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>>> help -<
>>>     
>
>
> _______________________________________________
>
> For details on ALL mailing lists and for joining or leaving lists, go 
> to http://list.cfdeveloper.co.uk/mailman/listinfo
>
> -- 
> CFDeveloper Sponsors:-
>> - cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>> - Lists hosted by www.Gradwell.com -<
>> - CFdeveloper is run by Russ Michaels, feel free to volunteer your 
>> help -<


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<



_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to