'How does the new Google Sign in Button (Google Identity GSI) determine user locale?

https://developers.google.com/identity/gsi/web/reference/js-reference#locale

The pre-set locale of the button text. If it's not set, the browser's default locale or the Google session user’s preference is used. Therefore, different users might see different versions of localized buttons, and possibly with different sizes.

I am located in Lithuania (people use Lithuanian (lt) language here)

If I open up the page with login button on incognito window than the button is rendered in lt locale.

In console navigator.languages is ['en']

Network requests to page and GSI client lib are accept-language: en

How does this happen if I leave the login button locale empty? (default)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source