ChristopherKlay / StadiaEnhanced

Various new features for Google Stadia
GNU General Public License v3.0
261 stars 31 forks source link

Update the recommended way of retrieving your current language. #10

Closed Mafrans closed 4 years ago

Mafrans commented 4 years ago

navigator.language is a much better way of retrieving the current language. Retrieving the language from the current webpage html is dependent on that webpage (in this case GitHub) actually supporting your language.

ChristopherKlay commented 4 years ago

The reason i use document.querySelector("html").getAttribute("lang"); and specified to open Stadia in the first step is that it returns the language setting used by Google/Stadia based on the logged in Google account, while navigator.language returns the language setting of the browser UI. The query above is meant to be Stadia specific to begin with.

Not only is it very unprofessional to overwrite page specific settings with browser-wide settings, those two are also not the same language in lots of cases. A lot of people (myself included) use one or the other in a different language, which in my case would result in having english UI elements (because Chrome is set to english) on a german (Google account set to german) Stadia page.