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

Fall back to DEFAULT_LOCALE when translation settings schema is invalid in get_current_locale #207

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

telamonian
Copy link
Member

Needed to fix final CI bug for jupyterlab/jupyterlab#10929. Essentially, this PR restores the pre-#205 behavior by which a missing or malformed translation settings schema would result in get_current_locale returning DEFAULT_LOCALE. This PR also slightly improves said old behavior by producing an informative warning when this happens, instead of being silent like before.

Tested locally, fixes the problem.

pinging @fcollonval, @blink1073

@jupyterlab jupyterlab deleted a comment from welcome bot Sep 7, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2021

Codecov Report

Merging #207 (5d66489) into master (eae679e) will decrease coverage by 0.23%.
The diff coverage is 56.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
- Coverage   77.30%   77.06%   -0.24%     
==========================================
  Files          28       28              
  Lines        2058     2067       +9     
==========================================
+ Hits         1591     1593       +2     
- Misses        467      474       +7     
Impacted Files Coverage Δ
jupyterlab_server/settings_handler.py 82.22% <50.00%> (-5.28%) ⬇️
jupyterlab_server/settings_utils.py 83.57% <60.00%> (-1.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eae679e...5d66489. Read the comment docs.

…settings schema is not valid

- needed to fix final CI bug for jupyterlab/jupyterlab#10929
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thank you!

@blink1073 blink1073 added the bug label Sep 7, 2021
@blink1073 blink1073 added this to the 2.8 milestone Sep 7, 2021
@blink1073 blink1073 merged commit 680f4fe into jupyterlab:master Sep 7, 2021
except web.HTTPError as e:
# fallback in case of missing (404) or misshapen (500) translation schema
locale = DEFAULT_LOCALE
'Failed loading or validating translation settings schema'
Copy link
Member

@fcollonval fcollonval Sep 8, 2021

Choose a reason for hiding this comment

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

@telamonian Should this be wrapped in self.log.warn? Is it needed to handle the error here even with the handling of the error within get_current_locale?

@fcollonval fcollonval mentioned this pull request Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants