Update certificate text depending on gender?

Hi, there!
How I can take user gender in certificate template in :
/edx/app/edxapp/edx-platform/lms/templates/certificates/_accomplishment-rendering.html
Example when I give certificate to gender female, cause I’m running on russian language, I need to add endings to words.
I think add in JS and django template, like:
if DJANGO_LANGUAGE == ‘RU’:
{some html}
<script>
document.get.elementByID(“some_id”)
get inner text
update ending of words
</script>

2 Likes

Hello @Chack!

I’m not sure how useful my reply is by now haha. To my knowledge, the certificate context doesn’t include any gender information, unfortunately. But I do have somewhat of a hacky solution in mind…

Setup edxapp plugin middleware to add the user’s gender to the context. Or you can just edit the edX platform’s lms/djangoapps/certificates/views/webview.py.

Once you’re passing the gender, you’ll want to create a custom certificate template either for all courses, or for all courses in an organization, or for a specific course.
In the custom certificate template, you want to use the django template to create the if/else condition based on the extra gender context your middleware is injecting.

Let me know, though, if this doesn’t meet your expectations please and I’ll try to think of an alternative if possible. :smiley: