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

feat: add i18n_js_namespace to support atlas - FC-0012 #452

Conversation

shadinaif
Copy link
Contributor

Implement OEP-58 JavaScript translations

Details:

Testing

Local tutor 17.0.2

  • translations are still working including JS translations. I added a temporary console log and it showed the translation correctly (to avoid the hustle connecting a real LTI)
    console.log(gettext('LTI Consumer'))
    Screenshot from 2024-02-28 11-58-10

References

This pull request is part of the FC-0012 project which implements the Translation Infrastructure update OEP-58.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 28, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @shadinaif! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@shadinaif
Copy link
Contributor Author

please review @OmarIthawi

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 97.77%. Comparing base (516d289) to head (a6180f8).

Files Patch % Lines
lti_consumer/utils.py 57.14% 3 Missing ⚠️
lti_consumer/lti_xblock.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #452      +/-   ##
==========================================
- Coverage   97.85%   97.77%   -0.08%     
==========================================
  Files          77       77              
  Lines        6705     6736      +31     
==========================================
+ Hits         6561     6586      +25     
- Misses        144      150       +6     
Flag Coverage Δ
unittests 97.77% <83.33%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@OmarIthawi OmarIthawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shadinaif!!

Please remove non-essential mocking code. That should make the PR easier to review.

Comment on lines +797 to +804
@property
def i18n_service(self):
""" Obtains translation service """
i18n_service = self.runtime.service(self, "i18n")
if i18n_service:
return i18n_service
else:
return DummyTranslationService()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change. I don't think it's needed.

"""
Return the JavaScript translation file provided by the XBlockI18NService.
"""
if url_getter_func := getattr(self.i18n_service, 'get_javascript_i18n_catalog_url', None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if url_getter_func := getattr(self.i18n_service, 'get_javascript_i18n_catalog_url', None):
if i18n_service := self.runtime.service(self, "i18n"):
if url_getter_func := getattr(i18n_service, 'get_javascript_i18n_catalog_url', None):

No need for the DummyTranslationService imho. Keeping the code simpler is better.

@OmarIthawi OmarIthawi self-requested a review February 28, 2024 09:29
@OmarIthawi
Copy link
Member

@shadinaif please mark this one as draft!

@OmarIthawi
Copy link
Member

being merged in #445

@OmarIthawi OmarIthawi closed this Mar 17, 2024
@openedx-webhooks
Copy link

@shadinaif Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants