-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use athena-negotiation
to detect language through Accept-Language header
#2324
Use athena-negotiation
to detect language through Accept-Language header
#2324
Conversation
I don't really understand the difference between athena and just the "normal" guess of the browser language... Isn't the "normal guess" supposed to detect the browser language? What does this do "more"? |
There is no "normal guess", it's just the server that have some code on the server side that is detecting the proper browser language. #2299 is trying to detect the proper browser language without introducing any external library/dependency, but it requires a lot of codes. |
The implementation in #2299 does an exact match. So, if we have a header like this:
And decide to use that against the languages supported by Invidious We'll get
This is the behavior seen in athena |
Perfect. Let's go with this then. |
f2e2dfd
to
f2005aa
Compare
f2005aa
to
3202e4b
Compare
@syeopite The reason I checked the header again on signup is for users that signup without any previously saved preferences. The following code creates a new user: invidious/src/invidious/routes/login.cr Line 436 in 7afa027
but uses the default user preferences: invidious/src/invidious/users.cr Line 381 in 75d04a9
the preferences for the new user are then updated, but only if they have a saved invidious/src/invidious/routes/login.cr Lines 462 to 469 in 7afa027
Without checking the header again during signup, the user will be created with the default locale of |
Yep, I just realized that... I was actually writing a reply (discarded now) to my post above when you posted a comment here. Either way, I'll go ahead and add back the extra parsing there. |
@afrmtbl to receive your reward either send your BTC address in a comment (preferred), or contact us directly, with a proof that this is indeed you. |
The address is |
A 20$ bounty has been rewarded to @afrmtbl for this PR. Transaction (48034f558cc7f2074ef1812f1320f50b8b48c4b7383a7680576b54e9866ef6a2): Amount sent: 0.00041820 BTC (~17.05€ or ~20$) Mining fees (5 sat/byte): 0.0000071 BTC (~0.29€) |
Closes #2074
Follow up to #2299 (comment)
Please give my bounty of #2074 to @afrmtbl when merging