I’m trying to related the value of my dropdown to a tag. So, if I choose the first item of my dropdown, my tag value would be 0 and if I choose the second item of my dropdown, my tag value would be 1. I did a OnChange script, it work when I do preview mode, but doesn’t when I’m in a browser.
What labels ? Are they displaying data related to the tag you’re changing ?
How do you handle translation - is it a global translation, or are you using the translate() expression function ?
They are simple label components. I enter all my translation into the Translation Manager and with my dropdown I change the session.props.locale value between “fr” and “en-US”.
So the dropdown is used to select the display language, or is that a different dropdown ?
If that’s the dropdown you were talking about, what’s that tag you are trying to modify supposed to do ?
Why don’t you just change the session.props.locale ? That’s what session properties are for, changing a tag will change the language in all clients. And it frankly makes things more complicated than they have to be…
Or does the tag have some other use ?
I’d suggest you bind your dropdown directly to session.props.locale, and let it handle one and only one thing.
Also, you might want to use fr-FR (or fr-CA, fr-BE, fr-CH…) instead of just fr.
I can also help you in french through private messages if you’d like, I’d rather keep the public forums english only.
That’s how we write locales. It makes it easy to see that it is indeed a locale, and some things need it to be in that format in order to parse it correctly.
In your case it might not change anything, but complying to conventions when writing code is a good habit to have.