signdict / website

A sign language dictionary
https://signdict.org
Mozilla Public License 2.0
82 stars 19 forks source link

Automatically show English website for if browser is English #1659

Open david-jones10 opened 11 months ago

david-jones10 commented 11 months ago

Addressing #228.

Hi @bitboxer ,

This MR offers a proposed solution to the above linked ticket.

It connects to the plug Plug.Accepts to access accept-language from the HTTP request headers when fetching the page. Then, it updates get_user_locale to attempt to read from the headers. If this fails, it falls back to the existing behaviour for fetching from user definition.

Please do test this thoroughly as I had some issues when running SignDict locally. I don't believe they were related to the changes, but as the owner I expect you'll have better luck running the environment fully compared to me!

Please let me know if there's any issues/changes you'd like to see.

Best, David

bitboxer commented 11 months ago

@david-jones10 thanks for this PR. It would be awesome if you add a test for this.