- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2014 11:26 AM
Hi, I need to display a msg if user language is "English". I am working with Var loginLanguage = g_user.getClientData("loginlanguage"); but the language value is undefined? my current language is English. Any help is appreciated.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2014 11:48 AM
There's a global variable called "g_lang" that you can use. The value would be "en" for English.
e.g. alert(g_lang) will display "en" in an alert dialog.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2014 07:25 PM
OK, good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2015 02:11 PM
Would you happen to know what the equivalent is for client side scripting in the mobile UI ?
g_lang doesn't seem to work there =o(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2015 11:51 AM
No, sorry, I do not. Would have to dig around. I wonder if CapaJC might know?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2015 01:24 PM
I had a look, and as far as I can tell, the mobile UI doesn't currently have a global variable that will give you that information. g_form and g_user exist, but neither will give you the user's language that I could tell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2015 11:34 AM
The best workaround I could come up with is to create a "Display" Business Rule on whatever table you need it on with the following code to add the language to the scratchpad:
(function(){
g_scratchpad.u_language = gs.getUser().getLanguage();
})();
You can then use "g_scratchpad.u_language" in a Client Script. Works with both the Desktop and Mobile UIs.
I was trying to use Session Client Data, but that was not even working in the full Desktop UI for some reason.