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: use atlas in make pull_translations #502

Merged
merged 1 commit into from
May 25, 2023

Conversation

OmarIthawi
Copy link
Member

@OmarIthawi OmarIthawi commented Apr 24, 2023

Changes

  • Move all i18n imports into src/i18n/index.js so intl-imports.js can override it with latest translations
  • Add atlas into make pull_translations when OPENEDX_ATLAS_PULL environment variable is set.

Testing

  • Fix tests and lint rules
  • Test pulled translations
  • Quick QA for translated content: image

References

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

Up-to-date project overview and details are available in the Approach Memo and Technical Discovery: Translations Infrastructure Implementation document.

Join the conversation on Open edX Slack #translations-project-fc-0012.

Check the links above for full information about the overall project.

Internalization is being rearchitected in Open edX Python, XBlock, Micro-frontend, and other projects. There are a number of immediately visible changes:

  • Remove source and language translations from the repositories, hence no .json, .po or .mo files will be committed into the repos.
  • Add standardized make extract_translations in all repositories
  • Push user-facing messages strings into openedx/openedx-translations.
  • Integrate root repositories with openedx/openedx-atlas to pull translations on build/deploy time

Breaking Changes

One of the primary goals of the project is to avoid breaking changes. If you noticed any suspicious code, please raise your concern. But before that, please know the strategy we're following to avoid breaking changes:

For Micro-frontends:

  • Legacy hardcoded translations are kept into the repo.
  • Consolidate all i18n imports into src/i18n/index.js
  • Add atlas integration in make pull_translations but only if OPENEDX_ATLAS_PULL is set
  • Bump frontend-platform and use intl-imports.js to generate up to date import files
  • If translations is missing, they're added according to the latest Micro-frontend i18n pattern in par with https://github.com/openedx/frontend-template-application/

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 24, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 24, 2023

Thanks for the pull request, @OmarIthawi! 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.

@OmarIthawi OmarIthawi marked this pull request as draft April 24, 2023 12:23
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b2b33b7) 91.88% compared to head (2c186d1) 91.88%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #502   +/-   ##
=======================================
  Coverage   91.88%   91.88%           
=======================================
  Files         170      170           
  Lines        3474     3474           
  Branches      905      905           
=======================================
  Hits         3192     3192           
  Misses        263      263           
  Partials       19       19           
Impacted Files Coverage Δ
src/index.jsx 0.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@OmarIthawi OmarIthawi marked this pull request as ready for review April 25, 2023 08:59
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

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

This looks great! One tiny comment then this should be good to go!

package.json Outdated Show resolved Hide resolved
@e0d
Copy link

e0d commented Apr 27, 2023

@OmarIthawi looks like a conflict was introduced, can you have a look?

@OmarIthawi
Copy link
Member Author

@e0d the conflicts seems to be resolve for other reasons.

@brian-smith-tcril
Copy link
Contributor

@jristau1984 @asadazam93 the spreadsheet says to inform you before merging this. It's ready to go, any reason I should hold off?

@brian-smith-tcril
Copy link
Contributor

@OmarIthawi looks like this has a conflict again

@brian-smith-tcril brian-smith-tcril added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label May 8, 2023
@OmarIthawi OmarIthawi force-pushed the atlas branch 2 times, most recently from 7f20148 to 716e03d Compare May 9, 2023 08:31
@OmarIthawi
Copy link
Member Author

@brian-smith-tcril done. cc: @jristau1984 @asadazam93

@brian-smith-tcril
Copy link
Contributor

@OmarIthawi looks like tests are failing on this one now

@OmarIthawi OmarIthawi force-pushed the atlas branch 2 times, most recently from 8d0de36 to 277a72c Compare May 9, 2023 16:56
@OmarIthawi
Copy link
Member Author

Those in principle, shouldn't fail. But I'm looking into them anyway.

@OmarIthawi OmarIthawi force-pushed the atlas branch 3 times, most recently from 889b1b6 to 7a1a8d6 Compare May 11, 2023 14:59
@asadazam93
Copy link
Contributor

@OmarIthawi we have another PR that upgrades the frontend platform version. I think it would make sense to merge that one first.

@OmarIthawi
Copy link
Member Author

@asadazam93 yes please, I'd love it if that happens soon :)

@brian-smith-tcril brian-smith-tcril added the blocked by other work PR cannot be finished until other work is complete label May 18, 2023
@brian-smith-tcril
Copy link
Contributor

I'm marking this as "blocked by other work" until #518 is resolved. I'll revisit next week and if the failing tests on master are still not resolved I'll consider merging it with failing tests.

Copy link
Contributor

@awais-ansari awais-ansari left a comment

Choose a reason for hiding this comment

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

@OmarIthawi Is this PR ready for merge?

@OmarIthawi
Copy link
Member Author

Yes, it's ready for merge @awais-ansari. Thanks for checking.

Copy link
Contributor

@awais-ansari awais-ansari left a comment

Choose a reason for hiding this comment

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

@OmarIthawi "@edx/frontend-platform": "4.2.0" required node 18 version and node upgrade is in progress now. For now. I’m blocking this PR on node 18 upgrade PR.

@awais-ansari awais-ansari removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label May 24, 2023
Copy link
Contributor

@awais-ansari awais-ansari left a comment

Choose a reason for hiding this comment

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

@OmarIthawi node 18 upgrades is done. Please rebase is PR with master and resolve the conflicts.

@awais-ansari awais-ansari added engineering review and removed blocked by other work PR cannot be finished until other work is complete labels May 25, 2023
Changes
-------
 - Move all i18n imports into `src/i18n/index.js` so `intl-imports.js` can
   override it with latest translations
 - Add `atlas` into `make pull_translations` when `OPENEDX_ATLAS_PULL`
   environment variable is set.

Refs: [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) implementing Translation Infrastructure OEP-58.
@awais-ansari awais-ansari merged commit 733a74d into openedx:master May 25, 2023
6 checks passed
@openedx-webhooks
Copy link

@OmarIthawi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

snglth pushed a commit to Abstract-Tech/community-theme-discussions that referenced this pull request Jan 9, 2024
Changes
-------
 - Move all i18n imports into `src/i18n/index.js` so `intl-imports.js` can
   override it with latest translations
 - Add `atlas` into `make pull_translations` when `OPENEDX_ATLAS_PULL`
   environment variable is set.

Refs: [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) implementing Translation Infrastructure OEP-58.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering review 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.

None yet

6 participants