-
-
Notifications
You must be signed in to change notification settings - Fork 62
User language control in the server #849
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
Conversation
Codecov ReportBase: 71.04% // Head: 71.04% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #849 +/- ##
=======================================
Coverage 71.04% 71.04%
=======================================
Files 53 53
Lines 3685 3685
Branches 2058 2058
=======================================
Hits 2618 2618
Misses 1065 1065
Partials 2 2 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Note that in this version dialects/language variants (like |
acd85aa
to
d383ee8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small question/update but we are mostly good.
What is the user impact of that, this seems important that |
It seems here, no javascript file is changed, so I wonder about my comment #750 (comment). How should we do, to change the code which handle the langauge selection box from javascript to c++? |
Can you please open a ticket for that? Otherwise it will be forgotten until a user complain about it. |
|
d703ba8
to
28e9fb4
Compare
Rebased on master and fixed-up. |
Fixes #750
Depends on #848
kiwix server determines the user language from three sources (in that order, earlier source takes precedence):
userlang
URL query parameteruserlang
cookieAccept-Language
headerIn all cases, the server sets the
userlang
cookie in its response using thus determined language.If
Accept-Language
is used and multiple language options are specified with weights, then the most suitable language is selected by scoring available translation languages - the score value is computed as the product of weight value and the number of translated strings for that language.