Hello Dears,
How can we get the logged in user locale or language preference in a Gadget script file?
Is there any built-in function available for this ?
Thanks and Regards,
Anish
Hello Dears,
How can we get the logged in user locale or language preference in a Gadget script file?
Is there any built-in function available for this ?
Thanks and Regards,
Anish
you can use the getUserPreferenceByName(āpreferenceNameā) API available in the SharedService.
In this case preference name is ācurrentUserLocaleā
e.g.
You can try including this code snippet you can include it in your gadget controller.js,
this.$scope.sharedService = SharedService;
var userName=this.$scope.sharedService.getUserPreferenceByName(ācurrentUserLocaleā);
note: pass SharedService as param to the init function of gadget controller.
Dear Yashwanth,
Thank you for your prompt response.
Appreciated.
Regards,
Anish