Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ability to change language via url redirect, added docstring #5342
(resubmitting against develop branch per request)
In multi-lingual environments, it is not user friendly for each user to change the default language manually with the drop-down box on the bottom of the page. This patch allows setting the language through a link, which then redirects the user to the requested content. We use this patch in RACHEL for our multi-lingual installations. You can see it in action here, where we link to English, French, and Spanish versions on the same server:
It would be nice if this functionality were included in the official release.
This looks good, except we now have a new test failure :) This is reported in Circle CI...
I believe the test may be caused by calling the page by
You can run the failing test like this:
Current coverage is 51.22% (diff: 4.00%)
@@ develop #5342 diff @@ ========================================== Files 141 141 Lines 7447 7458 +11 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 3812 3820 +8 - Misses 3635 3638 +3 Partials 0 0
Ah, good idea. I have made this change and committed to this branch.
One problem, though -- I tested this change manually, but I was not able to run the test code as directed. When trying against my branch, I got "ImportError: No module named kalite" and when I tried under the master branch I got "ImportError: No module named dbbackup". Sorry, I'm not familiar enough with python and django :/
I guess we'll see if the automatic CircleCI tests turn anything up. Thanks for your help so far!
@needlestack thanks that's great!! I would think that now we have the tests working, then it's safe to merge. Judging from the previous fail then the tests do reach part of the function.
codecov/patch is the metric for the code that's affected - I think it means that tests has only reached 4% of the changed lines.
Overall, it stacks up, but it means that you have contributed code where I have to rely on your assertion that it's working and my own ability to read code :)
But it's all good! I will write something for the release notes and possibly add a quick remark to ensure that future devs are able to understand why this code is there.