jakubgarfield / Bonobo-Git-Server

Bonobo Git Server for Windows is a web application you can install on your IIS and easily manage and connect to your git repositories. Go to homepage for release and more info.
http://bonobogitserver.com
MIT License
1.81k stars 605 forks source link

Appreciate User's language/locale, as sent by WWW browser #862

Open the-Arioch opened 4 years ago

the-Arioch commented 4 years ago

Just installed last releaased Bonobo 6.5.0 on Win 8.1 Rus

Opening the page - i see all of it in English. There is a global override in server configuration, that will affect all the site users.

But there should not be a need for overrides. Overrides are essentialyl fallbacks for errors, unresolved automatically.

According to http://www.xhaus.com/headers my browser sends the following headers:

Accept  text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Encoding gzip, deflate
Accept-Language ru-RU,ru;q=0.9,en;q=0.8
Cache-Control   max-age=259200
Connection  keep-alive
Dnt 1
Host    www.xhaus.com
Referer http://www.google.ru/url?esrc=s&q=&rct=j&sa=U&url=http://www.xhaus.com/headers&ved=2ahUKEwi-kNiMp5XoAhXSMJoKHbldDHUQFjABegQIChAB&usg=AOvVaw0SIEryEPsS2h8jwYnYjP7a
User-Agent  Opera/9.80 (Windows NT 6.2) Presto/2.12.388 Version/12.18

As you can see, Accept-Language header already sends priority-weighted list of languages.

Bonobo should just use it, and match the list of requested languages to its list of available languages.

The global override (and forceful ignoring of user-specified language), the only behavior possible in Bonobo 6.5.0, has to become an emergency option, that almost no one uses.