Skip to content
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

Translation of search results page #1046

Merged
merged 6 commits into from
Feb 1, 2024
Merged

Conversation

veloman-yunkan
Copy link
Collaborator

Fixes #1028

Contrary to #1032 (comment), no front-end side translation is performed on the search results page. Instead the /search endpoint is called with the userlang query parameter explicitly provided. The downside is the reduced opportunity for HTTP-caching search requests coming from users using different UI languages.

Currently no real translations of messages related to search results are available. To test this change you will have to use the test language that is excluded from the UI language selector. It can be set by adding (once) ?userlang=test after /viewer in the browser address bar.

Known issues:

  • changing the UI language while a search results page is loaded in the viewer doesn't automatically re-translate it but reloading the viewer does it.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: Patch coverage is 26.08696% with 17 lines in your changes missing coverage. Please review.

Project coverage is 39.36%. Comparing base (795fcb9) to head (34cd553).
Report is 128 commits behind head on main.

Files with missing lines Patch % Lines
src/search_renderer.cpp 15.78% 0 Missing and 16 partials ⚠️
src/server/internalServer.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1046   +/-   ##
=======================================
  Coverage   39.35%   39.36%           
=======================================
  Files          58       58           
  Lines        4060     4075   +15     
  Branches     2236     2245    +9     
=======================================
+ Hits         1598     1604    +6     
  Misses       1091     1091           
- Partials     1371     1380    +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kelson42
Copy link
Collaborator

@veloman-yunkan I guess its time to rebase this PR.

However it is NOT actually translated by the backend yet
However it is NOT actually translated by the backend yet
However it is NOT actually translated by the backend yet
Now the search results page is presented by the backend in the language
controlled by the value of the `userlang` URL query parameter (or, if
the latter is missing, the value of the `Accept-Language:` HTTP header).

Note that the front-end doesn't yet take advantage of this
functionality.
@veloman-yunkan veloman-yunkan force-pushed the translation_of_search_results_page branch from 1cde0dd to 34cd553 Compare February 1, 2024 14:34
@veloman-yunkan
Copy link
Collaborator Author

veloman-yunkan commented Feb 1, 2024

@veloman-yunkan I guess its time to rebase this PR.

@kelson42 You are right. I could sense the same recommendation in my horoscope for today and humbly complied with it.

Copy link
Member

@mgautierfr mgautierfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@kelson42 kelson42 merged commit 09eec82 into main Feb 1, 2024
15 of 16 checks passed
@kelson42 kelson42 deleted the translation_of_search_results_page branch February 1, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search results page is not translated
3 participants