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

Assignment's Due Date translation - Only part of the string is being translated #34951

Open
Rodra opened this issue Jun 7, 2024 · 0 comments

Comments

@Rodra
Copy link
Contributor

Rodra commented Jun 7, 2024

Conditions

The conditions required to trigger the bug are:

  • Have a course with a unit that has an assignment in it.
  • Have this waffle flag enabled for the course completion.enable_completion_tracking.
  • Configure a Due Date for that assignment as shown in the following image:
    • Screenshot 2024-06-07 at 3 56 53 PM
  • Have a user enrolled in that course.
  • When entering the assignment logged in as the user enrolled, you should be able to see the Due Date on top of the assignment content as shown in the screenshot:
    • image

When changing the Site Language through the user preferences page
image

The Due Date should be translated accordingly but only the word Due is translated. The subsection_format and date remain in the same language.

Screenshot 2024-06-07 at 3 41 21 PM Screenshot 2024-06-07 at 3 41 57 PM

Expected Results

Screenshot 2024-06-07 at 3 46 31 PM Screenshot 2024-06-07 at 3 47 04 PM

Trace

Django Template line of code that renders the Due Date
Due Date rendered in template

Dates for the unit are handled by custom JS: https://github.com/openedx/edx-platform/blob/master/lms/static/js/dateutil_factory.js . We currently localize the date format but not the actual date (i.e. based on the locale, we might get any of the following formats):

2018, 01 Jan 15:30 UTC
Jan 01, 2018 15:30 UTC
01 Jan, 2018 15:30 UTC
2018, Jan 01 15:30 UTC

But this part of the string along with the subsection_format are never sent through translation.

Suggestion

Changing the order of translation (format string, THEN translate instead of translate THEN format) would fix the issue.

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

No branches or pull requests

1 participant