Is there an easy way to detect the client browser language ?
session.props.locale is what you should use.
session.props.browserLocale is an old property from probably before the 8.0.0 release that has just hung around in my project.
Wow, I didn’t see that!!!
Oh, you’re right, that property was re-named and still exists in my project since it’s been around forever.
session.props.locale should provide what you’re looking for.
Is this local.prop.session initially set up by the browser or does it set up the browser?
I want to make sure this variable is set by the browser and not the other way around.
It looks like even if I modify that within the Designer new sessions will set the value to the locale in use by the browser.
- I set the locale to
fr-FRwithin the project.
- I placed a Label, and bound the label to session.props.locale`.
- Label displayed “fr-FR”.
- I saved the project.
- I opened a new session to the View which contained the Label.
- The Label displayed “en-US”.
I’m pretty sure that value can be used to SET the locale at runtime, but on session load I believe it will always pick up what the browser is using. If you modify the value after that then you’ve defined the locale to use yourself.