How to get the current Localization of the Web Browser.

I know how to change some values of the current FormatSettings and how it works with respect to the Web Browser. It's well explained in the TMS Web Core book from Dr. Holger Flick, but...

In my application, I use it to introduce data and display the configuration the user selects. When I communicate with the backend, I force a concrete format momentarily. That works well.

But sometimes, the backend returns values that must be shown to the final user in his language—the language of the Web Browser.

To accomplish this I need to send to the backend the language configuration of the Web Browser.

How can I get this value ('en-US', 'en-UK', 'es-US', 'es-ES', etc) in a variable?

Thanks in advance.

Some background:

In WEB Core, you can access for example:

showmessage(window.navigator.language);