Logged in user's language
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 01:49 AM
How can we check logged in user's language using client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 02:35 AM
Write a script include and get the current user's lanaguage:
var myUserObject = gs.getUser();
myUserObject.getLanguage(); -- returns the current user's language
Call this script include in client script using GlideAjax and you will have language in client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 02:38 AM
Hi Bhavesh,
Thx for your reply.
But i need to use client script for checking the user language.
Daniel.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 02:42 AM
There is one nice article for this in wiki.
http://wiki.servicenow.com/index.php?title=GlideUser_(g_user)#getClientData
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2014 02:51 AM
In addition: When the logged in user language is defined via the user preferences then it's stored in the sys_user table in the language field: preferred_language
Change on this are tracked in the sys_choice table.
The wiki says: The Language field in the User [sys_user] table overrides the default global language for that user's sessions.
The following sequence applies according the wiki:
1. If the language selection at login is enabled, that language is used.
2. If not, the language preference selected using the language picker in the header bar is used.
3. If not, the user's language setting in the User [sys_user] table is used.
4. If none of the above are true, the system default language is used.
So when you only let user define their preferred language in the profile settings then it's possible to refer to this field in the client script. But I assume you want to do this on active session which you just receive a good response on.