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

Feature: Multilingual support - Add request language middleware #148

Conversation

syphax-bouazzouni
Copy link

@syphax-bouazzouni syphax-bouazzouni commented May 6, 2024

Require

Context

This PR adds a middleware request_lang that will save for each request the parameter lang or language if set, as a global variable that will filter the values by it.

In addition, it updates the search helper, to add the selected language as a suffix of the SOLR requests, to search by the selected language only.

Changes

  • Add again SOLR config file as changed for the multilingual support (75b05fe)
  • Add request lang middleware to save as a global variable the request parameter "lang" or "language"(9435c7e)
  • Update the search helper to add as a suffix the selected language (f7eaf98)
  • Refactor test to be faster by doing the indexation only if needed (b5360d2)
  • Add multilingual search unit tests (84f079e)

@syphax-bouazzouni syphax-bouazzouni marked this pull request as draft May 6, 2024 08:40
@syphax-bouazzouni syphax-bouazzouni force-pushed the pr/sync-agroportal-bioportal branch from 1d35da7 to 84f079e Compare May 6, 2024 12:35
@syphax-bouazzouni syphax-bouazzouni changed the title Feature: Multilingual support Feature: Multilingual support - Add request language middleware May 6, 2024
@syphax-bouazzouni syphax-bouazzouni force-pushed the pr/sync-agroportal-bioportal branch from 88973e9 to 2a675bb Compare May 6, 2024 12:47
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.28%. Comparing base (f439e21) to head (88973e9).

❗ Current head 88973e9 differs from pull request most recent head 2a675bb. Consider uploading reports for the commit 2a675bb to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #148      +/-   ##
===========================================
+ Coverage    73.13%   73.28%   +0.15%     
===========================================
  Files           52       53       +1     
  Lines         2903     2916      +13     
===========================================
+ Hits          2123     2137      +14     
+ Misses         780      779       -1     
Flag Coverage Δ
unittests 73.28% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@syphax-bouazzouni syphax-bouazzouni marked this pull request as ready for review May 6, 2024 13:04
@alexskr
Copy link
Member

alexskr commented May 8, 2024

I understand why the Solr schema was added to the ontologies_api project in this PR; it eliminates the need to keep the ontoportal/solr-ut image synchronized when schema changes occur. A more elegant solution could be implemented to maintain schema synchronization between ontologies_api and ontologies_linked_data, but this requirement will disappear after the schemaless Solr feature is implemented. At that point, the Solr configuration could be removed from ontologies_api.

@alexskr alexskr changed the base branch from develop to feature/multilingual-support-add-request-language-middleware May 8, 2024 17:07
@alexskr alexskr changed the base branch from feature/multilingual-support-add-request-language-middleware to feature/multilingual-support-add-language-request-middleware May 8, 2024 17:15
@alexskr alexskr merged commit a208415 into ncbo:feature/multilingual-support-add-language-request-middleware May 8, 2024
2 checks passed
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.

3 participants