Copy link to clipboard
Copied
Bonjour,
Sur mon site, j'essaye de mettre en place une version multi-langues à base de sessions (<set session.lg="en">).
Or, lors du changement de pays, le cache intervient (je pense) et aucun changement ne se produit.
Je ne sais que faire 😞
Qu'en est-il du cache, des cookies ?
Merci par avance
Qu'en est-il du cache ?
Merci par avance
Hello,
On my site, I'm trying to set up a multi-language session-based version (<set session.lg = "en">).
However, when changing country, the cache intervenes (I think) and no change occurs.
I do not know what to do 😞
What about the cache, cookies?
thanks in advance
Thanks for your explanation. It is clear what you want to achieve.
Given your requirements, here are some suggestions:
@ZNB : ... a multi-language session-based version (<set session.lg = "en">)....The user has the possibility to choose his language when entering the site by clicking on a flag which toggles the session.lg according to the language.
A custom session variable, such as session.lg, is stored in memory. That is, on the server. Hence, not as a cookie on the client. Therefore, if
...Bonjour,
Merci pour votre retour.
C'est exactement ce que je voulais.
Cordialement
Hello,
Thanks for your feedback.
That's exactly what I wanted.
cordially
Copy link to clipboard
Copied
HELP
Copy link to clipboard
Copied
Let me understand your requirements. They are:
Is that so? If so, please explain how you achieve this.
How do you change the country? How do you relate this to session.lg?
Copy link to clipboard
Copied
Bonjour
Il n’y a qu’une seule version.
Tous les mots, phrases ou textes à traduire en base de données avec à chaque fois, une traduction suivant la langue.
L’utilisateur a la possibilité de choisir sa langue à l’entrée sur le site en cliquant sur un drapeau qui fait basculer la session.lg suivant la langue.
Malheureusement, cette dernière changée, cela n’a pas d’effet à moins de vider manuellement les cookies et le cache. Comment le faire automatiquement ?
Hello
There is only one version.
All the words, sentences or texts to be translated in a database with each time a translation according to the language.
The user has the possibility to choose his language when entering the site by clicking on a flag which toggles the session.lg according to the language.
Unfortunately, the latter changed, this has no effect unless you manually clear the cookies and cache. How to do it automatically?
Copy link to clipboard
Copied
Thanks for your explanation. It is clear what you want to achieve.
Given your requirements, here are some suggestions:
@ZNB : ... a multi-language session-based version (<set session.lg = "en">)....The user has the possibility to choose his language when entering the site by clicking on a flag which toggles the session.lg according to the language.
A custom session variable, such as session.lg, is stored in memory. That is, on the server. Hence, not as a cookie on the client. Therefore, if there is no change when the user clicks on the flag, it will mean that the application failed to update the value of session.lg.
One hypothesis is that, during the switch from one user to the next, the session stayed the same. By manually clearing the cookies you then forced ColdFusion to start a new session. I am assuming that you want a new session to start whenever a user clicks on a language flag.
Should this hypothesis be correct, I would implement the language requirement as follows:
1. Implement the login code right after you validate a successful user-login:
<cflogin>
<cfloginuser name = "bkbk" password = "bkbk-pw" roles = "user">
</cflogin>
2. Configure the application to store the user's login information in the session scope:
<!--- in Application.cfc --->
<cfset this.name = "AppName">
<cfset this.sessionManagement = true>
<cfset this.sessionTimeout = createTimeSpan(0,0,20,0)>
<cfset this.loginStorage="session">
3. Implement the logout code right after you log the user out:
<cflogout>
4. When a user clicks on the language flag:
<!--- Include code to log the user out --->
<!--- Code to invalidate the session --->
<cfset sessionInvalidate()>
<!--- Code to reset the language --->
<cfset session.lg="fr">
<!--- Include code to log the user in --->
5. When a user clicks on the country flag:
<!--- Include code to log the user out --->
<!--- Code to invalidate the session --->
<cfset sessionInvalidate()>
<!--- Code (query) to get the language, based on the country. For example, "fr" for France or Senegal --->
...
<!--- Code to reset the language --->
<cfset session.lg="fr">
<!--- Include code to log the user in --->
Copy link to clipboard
Copied
Bonjour,
Merci pour votre retour.
C'est exactement ce que je voulais.
Cordialement
Hello,
Thanks for your feedback.
That's exactly what I wanted.
cordially