- 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
‎12-07-2015 01:19 PM
if(CostValue == 'BADVALUE'){
alert(getMessage("u_catalog_please_enter_a_number"));
}
Sadly it looks like getMessage() wont work on the client side
Cheers,
- James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2015 01:50 PM
Weird, it actually works the second time around:
So if you want it to run 100% of the time and be performance friendly, you could create a new String variable for the item (or Variable Set if need on more items) with a default value of "javascript:gs.getUser().getLanguage();". Create a UI Policy to hide it so it is not visible to the user. Then you have the user's language:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2015 01:58 PM
Thanks, that is a far better solution that what I was doing with AJAX.
I will go with that.
Thanks!
- James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2015 02:04 PM
It's not ideal using a variable just for that, but sometimes we just have to use what we can
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2015 02:07 PM
Yep,.. the amount of workarounds I have had to set up for this implementation so far is just mindblowing. Hopefully Geneva will be better.