Return user language so to change the "locale" property

Hello everybody,

I cannot find a way to read the language properties of the gateway users.
I tried to use system.user.getUser but I don't have the language in the return variables.

I would like to read the setting language so to change directly the locale property of the session automatically.

Thank you

Can you post what you tried (and your Ignition version)? Looking at the code, that property should exist in the User object returned.

I'm not at work now, but I remember clearly that as return I had this 4 properties:
Username
First name
Last name
Roles

The code was very simple,

user = system.user.getUser("", 'myuser' )
print user

The ignition version is 8.1.43.
Thanks for the help.

afaik user.get('language') should work. Unfortunately I don't have time to test it right now.

2 Likes

No problem, thank you very much for the reply, I'll make some test tomorrow and I'll give you an update!

Have a nice day

@KathyApplebaum,
I can confirm that as you suggest everything works fine, thank you for the help.

3 Likes

I forgot to say that I'm able to change the language according with the user settings doing this:

  1. Create a custom session property
  2. Bind the authentication username
  3. Create on this custom property a Change Script that read the username and look for its language so to manage the > Locale session property