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: fix translations API #1013

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

zannkukai
Copy link
Contributor

Fixes bug with translations API. If an exception occurred during
execution of this API, the exception should be logged into the
current_app logger. But current_app context was never loaded from
flask module before.
This PR also hacks translation files data : if a string is not
translated, rather than return an empty string, the original string will
be used.

  • Adapts unitest to check theses cases.

Co-Authored-by: Johnny Mariéthoz Johnny.Mariethoz@rero.ch
Co-Authored-by: Renaud Michotte renaud.michotte@gmail.com

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Extracted translations?

@zannkukai zannkukai self-assigned this May 28, 2020
@zannkukai zannkukai force-pushed the zan-#fix-translations-api branch 2 times, most recently from ba926b7 to 419e227 Compare May 28, 2020 13:51
@zannkukai zannkukai requested review from jma and iGormilhit May 28, 2020 16:14
@zannkukai zannkukai marked this pull request as ready for review May 28, 2020 16:15
@zannkukai zannkukai requested a review from rerowep May 29, 2020 07:55
tests/api/test_translations.py Show resolved Hide resolved
Fixes bug with translations API. If an exception occurred during
execution of this API, the exception should be logged into the
`current_app` logger. But `current_app` context was never loaded from
flask module before.
This PR also hacks translation files data : if a string is not
translated, rather than return an empty string, the original string will
be used.

* Adapts unitest to check theses cases.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
@iGormilhit iGormilhit merged commit ca7be83 into rero:dev Jun 3, 2020
@iGormilhit iGormilhit mentioned this pull request Jun 3, 2020
7 tasks
@zannkukai zannkukai deleted the zan-#fix-translations-api branch June 5, 2020 11:49
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