-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Render enrollment emails in the student's language #6082
Render enrollment emails in the student's language #6082
Conversation
Thanks for the pull request, @regisb! I've created OSPR-244 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here. We can't start reviewing your pull request until you've submitted a signed contributor agreement or indicated your institutional affiliation and added yourself to the AUTHORS file. Please see the CONTRIBUTING file for more information. |
fe6725b
to
457cfee
Compare
@regisb this is a good fix! Please be sure to submit your contributors agreement as stated by the bot - we can't review it until that's straightened out. |
I just sent my contributor agreement yesterday; would you like a copy? |
Nope - our legal team will process it. It is Thanksgiving holiday for us in the USA, so expect more attention early next week. Thanks! |
457cfee
to
8d9a7f9
Compare
Sounds good! Meanwhile: it seems the Jenkins tests are failing because they were run on a previous version of my PR. Would you mind starting them again manually please? |
build should automatically trigger when you push a new commit and/or do a On Thu, Nov 27, 2014 at 11:03 AM, Régis B. [email protected] wrote:
|
8d9a7f9
to
01bc612
Compare
It seems that tests are passing: there are just a couple violations but they are due to previous commits. Do you think this PR can be merged? |
@regisb - there are quite a few steps that need to follw before this can be merged, please see our contributors documentation. The label on your PR lets you know what state your PR is in, right now it is "product review". We do product review every other week, the next review is this Thursday AM. We do need a passing build and communication from our legal team that your contributors agreement is in place, as well. |
d631b60
to
b2fdadb
Compare
@@ -291,6 +294,9 @@ def send_mail_to_student(student, param_dict): | |||
`is_shib_course`: (a `boolean`) | |||
] | |||
|
|||
`language` is the language used to render the email. If None the language | |||
currently active will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little confusing. Maybe, "If None, the language of the currently-logged in user (that is, the user sending the email) will be used."
This looks good. I have a few changes, and I'd like to see an additional test of the default case as well as the override case. |
@regisb I cannot verify this on a sandbox - I have a user set to French, and an instructor set to Chinese, with the platform language set to English. When the instructor invites the French user to beta test a course, the French user is still receiving the mail in English. |
@regisb - putting this ticket in "waiting on author". I restarted all my services on my sandbox and ran the manual test (French user, Chinese instructor, English platform language) again, and I still can't verify this PR works (student user gets email in English, not French). Can you please tell me how you tested this work manually, so I can try to manually verify this PR works? I also can't verify the problem you initially stated- you said the user gets the email in the instructor's language. But in my testing on master, I see the user always gets the email in the platform language (set by LANGUAGE_CODE), not the instructor's language. Also, your PR needs a rebase. |
Sarina, The unit test I wrote was failing before my fix. Perhaps can you try to run it without the rest of my PR?Régis Sent from my portable toaster. Please excuse the brevity. Le 12 décembre 2014 22:16:26 GMT+05:30, Sarina Canelake [email protected] a écrit :
|
Yes, when I tested this on master, I was logged in as a staff user with a Chinese language preference. I will test this again now. |
@regisb ah! OK now I am able to validate the fix. Cool! This is a very reasonable fix. |
""" | ||
|
||
# If language is None we default to the currently active language. Note | ||
# that this differs from the behaviour of override_language. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this differ from the behavior of override_language?
So, my only nagging question is about the default behavior. I feel that the right thing to do is actually to default to the platform language, not the instructor's language. For example if it is a France-based installation but there is a professor teaching a course in French. But he is from China so he sets his own platform language to be Chinese. I think it is more appropriate to default not to his language but to the platform language. @regisb what do you think about this? |
514a3b9
to
ce4ad04
Compare
@sarina Yes, what you are saying about the default behavior makes sense. I amended my PR and added a unit test to test_api_email_localization.py. |
@regisb cool! I will test today, and if tests pass & testing looks good, then we will be able to merge it 🎆 🎊 ❗ 😄 |
@regisb - can you take a look at your test failures? You have a quality issue (run |
@regisb : just ran a test of your branch and it looks great! Once the tests and quality issues are resolved, this is 👍 to merge. |
ce4ad04
to
653f922
Compare
@sarina : great :) |
@regisb eek. I'm very sorry but could I ask you to rebase one more time?
|
Enrollment, unenrollment and beta role emails should be rendered in the student's language, and not the instructor's language.
653f922
to
f3419bb
Compare
@regisb awesome, thank you so much! This is a great fix. |
Render enrollment emails in the student's language
Context: Course instructors have the option to enroll, unenroll and assign the "beta user" role to a list of manually-written email addresses. An email is then sent to each address to inform the address owner of the change.
Problem: the emails that correspond to existing users are not written in the user's language, but in the instructor's language.
Proposed solution: render the email messages and subject using the user's language, if available. If no user corresponds to a given email address, then the instructor's language is used (which is the current default behaviour).
This pull request is related to this Google groups conversation.