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: FC-0012 - add (--no-segment) option to extract_translations #33368

Merged

Conversation

shadinaif
Copy link
Contributor

@shadinaif shadinaif commented Sep 28, 2023

Description

Add --no-segment option to extract_translations. The flag is added if and only if IS_OPENEDX_TRANSLATIONS_WORKFLOW is set to yes. This a follow-up work to Decision to standardize django/djangojs po files

IS_OPENEDX_TRANSLATIONS_WORKFLOW flag is introduced and used by openedx-translations

References

This contribution 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 re-architected 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 notice any suspicious code, please raise your concern. But before that, please know the strategy we're following to avoid breaking changes

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

openedx-webhooks commented Sep 28, 2023

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 shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch 4 times, most recently from 0f2dd62 to 30e148a Compare September 28, 2023 07:33
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. I realize this is still work-in progress but I'm adding notes if it's useful.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@shadinaif shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch 3 times, most recently from fb42958 to f20c748 Compare October 4, 2023 13:06
@shadinaif shadinaif marked this pull request as ready for review October 4, 2023 13:06
@OmarIthawi
Copy link
Member

Thanks @shadinaif. Some tests are failing.

Sometimes we only need to rebase over master and that's it.

@shadinaif shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch from f20c748 to e55be0e Compare October 10, 2023 08:09
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!

This looks great!

Would you mind checking my last note? Same code but one less line.

Makefile Outdated
Comment on lines 45 to 49
cd conf/locale/en/LC_MESSAGES && msgcat djangojs.po underscore.po -o djangojs.po
cd conf/locale/en/LC_MESSAGES && msgcat django.po wiki.po edx_proctoring_proctortrack.po mako.po -o django_temp.po
cd conf/locale/en/LC_MESSAGES && mv django_temp.po django.po
cd conf/locale/en/LC_MESSAGES && rm wiki.po edx_proctoring_proctortrack.po mako.po underscore.po
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
cd conf/locale/en/LC_MESSAGES && msgcat djangojs.po underscore.po -o djangojs.po
cd conf/locale/en/LC_MESSAGES && msgcat django.po wiki.po edx_proctoring_proctortrack.po mako.po -o django_temp.po
cd conf/locale/en/LC_MESSAGES && mv django_temp.po django.po
cd conf/locale/en/LC_MESSAGES && rm wiki.po edx_proctoring_proctortrack.po mako.po underscore.po
cd conf/locale/en/LC_MESSAGES && msgcat djangojs.po underscore.po -o djangojs.po
cd conf/locale/en/LC_MESSAGES && msgcat django.po wiki.po edx_proctoring_proctortrack.po mako.po -o django.po
cd conf/locale/en/LC_MESSAGES && rm wiki.po edx_proctoring_proctortrack.po mako.po underscore.po

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Makefile Outdated
Comment on lines 40 to 42
# (IS_OPENEDX_TRANSLATIONS_WORKFLOW) is set to "yes" when openedx-translations calls this target.
# Otherwise, we preserve the old behavior of having segmented po files.
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
# (IS_OPENEDX_TRANSLATIONS_WORKFLOW) is set to "yes" when openedx-translations calls this target.
# Otherwise, we preserve the old behavior of having segmented po files.
# (IS_OPENEDX_TRANSLATIONS_WORKFLOW) is set to "yes" when openedx-translations repository extracts translations.
# Related doc: https://docs.openedx.org/en/latest/developers/how-tos/enable-translations-new-repo.html
# Otherwise, we preserve the old behavior of having segmented po files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@OmarIthawi
Copy link
Member

@shadinaif I've added two minor notes. Please test it on the openedx-translations repo to ensure the workflow is working.

@shadinaif shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch 2 times, most recently from c028dfa to d6fc155 Compare October 12, 2023 10:51
@shadinaif
Copy link
Contributor Author

Tested, and ready to be merged @OmarIthawi @brian-smith-tcril

@OmarIthawi
Copy link
Member

@jmbowman this is another FC-0012 pull request that needs your review.

@OmarIthawi
Copy link
Member

@shadinaif please add the FC-0012 suffix to the title.

@shadinaif shadinaif changed the title feat: add (--no-segment) option to extract_translations feat: FC-0012 - add (--no-segment) option to extract_translations Oct 12, 2023
@shadinaif shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch from d6fc155 to dac8523 Compare October 16, 2023 05:27
Makefile Outdated Show resolved Hide resolved
@@ -37,8 +37,19 @@ technical-docs: ## build the technical docs
guides: swagger ## build the developer guide docs
cd docs/guides; make clean html

# (IS_OPENEDX_TRANSLATIONS_WORKFLOW) is set to "yes" when openedx-translations repository extracts translations.
# Related doc: https://docs.openedx.org/en/latest/developers/how-tos/enable-translations-new-repo.html
Copy link
Contributor

Choose a reason for hiding this comment

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

it's not clear reading through this doc how it is related to this. I think it makes more sense to link to https://github.com/openedx/edx-platform/blob/59ddee7ad3363bf9f4bfae355fa3f24a1bbdfb37/docs/decisions/0018-standarize-django-po-files.rst once it is merged instead.

Makefile Outdated Show resolved Hide resolved
@OmarIthawi
Copy link
Member

OmarIthawi commented Oct 28, 2023

@dianakhuang would you mind taking a look on this pull request?

@shadinaif please let me know if there's anything we can do to push the PR forward.

@OmarIthawi
Copy link
Member

@shadinaif would you mind checking the notes in the review?

@shadinaif shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch from dac8523 to 096798e Compare November 8, 2023 10:15
The flag is added if and only if (IS_OPENEDX_TRANSLATIONS_WORKFLOW) is set to "yes"

Refs: FC-0012 OEP-58
@shadinaif shadinaif force-pushed the shadinaif/FC-0012-OEP-58.no-segment branch from 096798e to 3b26280 Compare November 9, 2023 15:13
@shadinaif
Copy link
Contributor Author

Tested here @OmarIthawi , please review

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.

Looks great! Thanks @shadinaif!

@brian-smith-tcril
Copy link
Contributor

@dianakhuang you're listed as "Review required from" for this repo on the spreadsheet. Any chance you could review/merge this one?

Copy link
Contributor

@dianakhuang dianakhuang left a comment

Choose a reason for hiding this comment

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

yup @brian-smith-tcril ! It was on my radar, but I figured I'd let everyone else get to it first. Looks good to me.

@dianakhuang dianakhuang merged commit ffe3bf8 into openedx:master Nov 15, 2023
64 checks passed
@openedx-webhooks
Copy link

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

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@shadinaif shadinaif deleted the shadinaif/FC-0012-OEP-58.no-segment branch November 16, 2023 08:05
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.

6 participants