kiwix / libkiwix

Common code base for all Kiwix ports
https://download.kiwix.org/release/libkiwix/
GNU General Public License v3.0
118 stars 56 forks source link

Cookieless user language control #997

Closed veloman-yunkan closed 1 year ago

veloman-yunkan commented 1 year ago

Fixes #995

A known issue with this fix is that the relatively expensive handling of the "Accept-Language" header is now being performed for all requests (unless the user language is explicitly specified in the URL query: ?userlang=...). I will fix it after this PR clears all other hurdles of the review process.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.03% :warning:

Comparison is base (c6456ca) 38.89% compared to head (cc6aa9b) 38.87%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #997 +/- ## ========================================== - Coverage 38.89% 38.87% -0.03% ========================================== Files 58 58 Lines 4008 4000 -8 Branches 2205 2200 -5 ========================================== - Hits 1559 1555 -4 - Misses 1099 1101 +2 + Partials 1350 1344 -6 ``` | [Files Changed](https://app.codecov.io/gh/kiwix/libkiwix/pull/997?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kiwix) | Coverage Δ | | |---|---|---| | [src/server/request\_context.cpp](https://app.codecov.io/gh/kiwix/libkiwix/pull/997?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kiwix#diff-c3JjL3NlcnZlci9yZXF1ZXN0X2NvbnRleHQuY3Bw) | `60.36% <ø> (-1.38%)` | :arrow_down: | | [src/server/request\_context.h](https://app.codecov.io/gh/kiwix/libkiwix/pull/997?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kiwix#diff-c3JjL3NlcnZlci9yZXF1ZXN0X2NvbnRleHQuaA==) | `95.23% <ø> (ø)` | | | [src/server/response.cpp](https://app.codecov.io/gh/kiwix/libkiwix/pull/997?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kiwix#diff-c3JjL3NlcnZlci9yZXNwb25zZS5jcHA=) | `57.45% <ø> (+1.23%)` | :arrow_up: | | [src/server/internalServer.cpp](https://app.codecov.io/gh/kiwix/libkiwix/pull/997?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kiwix#diff-c3JjL3NlcnZlci9pbnRlcm5hbFNlcnZlci5jcHA=) | `33.55% <50.00%> (-0.06%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

veloman-yunkan commented 1 year ago

I think that this PR introduced a small problem - now the text on error pages will be in the language detected from the value of the "Accept-Language" header (since the information about the user-selected language is no longer sent to the server).

kelson42 commented 1 year ago

@veloman-yunkan can you please open a new ticket? maybe provide a fix?

veloman-yunkan commented 10 months ago

@veloman-yunkan can you please open a new ticket?

Done (#1019)