-
Notifications
You must be signed in to change notification settings - Fork 303
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
0.13.x to central-develop #3454
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert web+graphie: URLs into local paths, and download into assessment item packs
Checks that item_data is a dict before attempting to inspect it as one
See, in smart_translate_item_data we always assumed that a list inside assessment items is always a dict. Now, apparently it always isn't, based on the behaviour we see from KA's code: https://gist.github.com/aronasorman/e8f77ad7444d55c5a5e1#file-models-py-L127 So now we just replicate that behaviour in smart_translate_item_data by translating strings, and returning immediately.
smart_translate_item_data: translate strings automatically
We apparently can also get a list of lists; handle those cases, and refactor code to be more defensive in general.
This is where the actual title is set, not on the exercise view render method. So we put the gettext method here!
Revert back to the string found in the po file.
Ugh. Looks like $._ was a noop, as it just interpolated strings? This time, we actually translate them by passing it into our own gettext method.
Before, we translated based on exercise_lang, whose value is whatever get_best_available_language returns for a given set of languages. However, those set of language choices we pass in are those we have translated exercise templates for. When translating for perseus, this is not the case. So what we do here instead is just localize for whatever language we originally requested for get_exercise_cache in the first place. If it's not there, gettext automatically falls back to English.
Going to have a few more things coming in here, related to reg, shortly. Then we can merge. |
This reverts commit 354c2d4.
More i18n fixes
Registration tweaks (destined for central server submodule)
…_plus_handling_in_reg
This avoids a "peer did not return certificate" error being thrown.
Tweaks to help with debugging reg errors on the central server
Commented out "dev-only" alert in Perseus that gets shown to users.
Replace urllib.urlopen with more robust requests.get method.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Needed for the i18n fixes.