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

0.13.x to central-develop #3454

Merged
merged 30 commits into from
Apr 3, 2015
Merged

0.13.x to central-develop #3454

merged 30 commits into from
Apr 3, 2015

Conversation

aronasorman
Copy link
Collaborator

Needed for the i18n fixes.

jamalex and others added 10 commits March 27, 2015 23:27
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
@aronasorman aronasorman self-assigned this Mar 30, 2015
@aronasorman aronasorman added this to the 0.13.0 milestone Mar 30, 2015
aronasorman and others added 7 commits March 31, 2015 15:59
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.
@jamalex
Copy link
Member

jamalex commented Apr 2, 2015

Going to have a few more things coming in here, related to reg, shortly. Then we can merge.

aronasorman and others added 4 commits April 3, 2015 11:56
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.
aronasorman added a commit that referenced this pull request Apr 3, 2015
@aronasorman aronasorman merged commit 5f82a77 into central-develop Apr 3, 2015
@aronasorman aronasorman removed the has PR label Apr 3, 2015
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