# Setting Locale at Client startup, user.getOrDefault(user.Language) returns None

**URL:** <https://forum.inductiveautomation.com/t/setting-locale-at-client-startup-user-getordefault-user-language-returns-none/16252>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [December 7, 2017, 9:50pm UTC](https://forum.inductiveautomation.com/t/setting-locale-at-client-startup-user-getordefault-user-language-returns-none/16252 "2017-12-07T21:50:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [December 7, 2017, 9:50pm UTC](https://forum.inductiveautomation.com/t/setting-locale-at-client-startup-user-getordefault-user-language-returns-none/16252/1 "2017-12-07T21:50:37Z")

</div>

In my projects I am using AD-Internal, and at Client startup I try to set the user’s preferred Language.

One thing that I have noticed is that in order to retrieve a not None value for a user’s Language I have to manually select a language first.

```auto
DEFAULT_LANGUAGE = 'en_US'
# Get the user from SSO profile:
user = system.user.getUser("AD-Internal_Auth", system.security.getUsername())

if user is None:
    system.util.setLocale(DEFAULT_LANGUAGE)
elif user.getOrDefault(user.Language) is not None:
    system.util.setLocale(user.getOrDefault(user.Language))
else:
    system.util.setLocale(DEFAULT_LANGUAGE)

```

All of the users retrieved from AD have “English (United States)” as their language, but when I run the script above, user.getOrDefault(user.Language) returns None. It’s not until I edit the user that it does return the user’s language.

I expect that getOrDefault would return the Default value as [documented](https://docs.inductiveautomation.com/display/DOC79/system.user.getUser), but it returns None instead.

Is there something I am missing?

Should I be setting the Default language somewhere in Ignition’s configuration?

Currently I have a workaround in place; I am just curious about the expected behavior versus reality.

Thanks,  
Cesar
