Server/Client Language variable

The API i work with has the ability to return data in whatever language you request. For example, if i pass 'locale:enUS' to the API, the results are returned in English. ptBR returns results in Portuguese. And so on. So, my question is how can i see the language that the user has set for either the PMS server or client and pass that to my API? Is there a system variable i can use or query? Or is there some kind of function i can run to get this information? Most of the language questions on this forum were centered around localization so i wasn't having much luck finding anything. 

 

Thanks!

The documented way is to use Locale.CurrentLocale (described here). But there are some issues with it that I was inquiring about in another thread some time ago.

TL;DR version: most of the times you won't get the correct value or any value at all, but the post in that thread marked as a "solution" links to a file that you may add to your channel to improve the results considerably, although not in all cases.