I need to retrieve the language of the logged in user. How can I do this?
Locale is available as part of context and you can retrieve it from custom UI, for instance:
console.log('User locale: ' + aps.context.locale);
, it will return the user's locale in following form:
User locale: en_US