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

docs: add the Python Repo section into OEP-58 docs #366

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

OmarIthawi
Copy link
Member

@OmarIthawi OmarIthawi commented Aug 8, 2023

document the new translation workflow for Python Repo.

I'll be filling the other sections in upcoming PRs.

For now the controversial part is whether we should be recommending i18n_tool extract or use django-admin.py makemessages. My memory isn't helping me to determine which does what, so I'll be asking for help from @shadinaif and of course @sarina who have used both a ton.

Preview the file here: https://github.com/Zeit-Labs/docs.openedx.org/blob/mfe-atals-docs/source/developers/how-tos/enable-translations-new-repo.rst

This pull request is open against a parent one that'll be merged later:


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

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

openedx-webhooks commented Aug 8, 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.

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.

Thank you so much for writing up these docs! I left quite a few comments but overall this is wonderful! Looking forward to seeing these come together!

Comment on lines 9 to 10
Enabling translations on a new repo is mostly starting from an up-to-date cookiecutter
and the rest is ensuring that the repo is configured correctly.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think linking to the cookiecutter and configuration docs might be helpful, maybe something like:

"The easiest way to enable translations on a new repository is to use an up-to-date cookiecutter, and ensure the repository is configured correctly"

Enabling translations on a new repo is mostly starting from an up-to-date cookiecutter
and the rest is ensuring that the repo is configured correctly.

However, this guide will assume that you're starting from scratch.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what you mean by "starting from scratch" here, it seems both the python and react repo instructions mention cookiecutters/templates.

Comment on lines 14 to 28
The `OEP-58: Translations Management <https://docs.openedx.org/projects/openedx-proposals/en/latest/architectural-decisions/oep-0058-arch-translations-management.html>`_
proposal introduced new workflows and tooling to the Open edX translation management:

- Created the new `openedx-translations project <https://app.transifex.com/open-edx/openedx-translations/dashboard/>`_
in Transifex.
- Created the new `openedx-translations repo <https://github.com/openedx/openedx-translations>`_
in GitHub.
- Setup two-way links between the Transifex project and the GitHub repo via the
`Transifex GitHub app <https://github.com/apps/transifex-integration>`_.
- Added new the `atlas <https://github.com/openedx/openedx-atlas>`_ command line tool to pull translations which will be used in the repo Makefiles, build and deploy processes to fetch translations from the
`openedx-translations repo <https://github.com/openedx/openedx-translations>`_.

The full background and rational for the new workflows and tooling can be found in the
`OEP-58: Translations Management <https://docs.openedx.org/projects/openedx-proposals/en/latest/architectural-decisions/oep-0058-arch-translations-management.html>`_
docs.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might make sense to have this be at the top of this document. It seems everything above this is also covered in the individual repo type sections, so that may not be needed.

source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
`openedx-translations repo <https://github.com/openedx/openedx-translations>`_.

The full background and rational for the new workflows and tooling can be found in the
`OEP-58: Translations Management <https://docs.openedx.org/projects/openedx-proposals/en/latest/architectural-decisions/oep-0058-arch-translations-management.html>`_
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: we tend to not use inline links in the middle of paragraphs like this. This is mostly for readability when editing the rst files, it's nice to just see

The full background and rationale for the new workflows and tooling can be found in the
`OEP-58: Translations Management`_ docs.

source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
@OmarIthawi OmarIthawi force-pushed the mfe-atals-docs branch 6 times, most recently from 2f51afc to 110dd4b Compare September 3, 2023 12:21
@OmarIthawi OmarIthawi force-pushed the mfe-atals-docs branch 8 times, most recently from bfbd690 to 619d20c Compare September 4, 2023 04:54
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.

Overall this is looking great! Left a few comments with suggestions to make some parts a little less wordy, and a couple with questions about the order of instructions (what should be done pre/post PR)

source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
Comment on lines 101 to 106
7. Install the XBlock or plugin in a devstack and run the ``OPENEDX_ATLAS_PULL=true make pull_translations`` in
the edx-platform repo to preview the translations in devstack.

This step is somewhat oversimplified and assumes you're familiar with the Open edX development workflow whether
you're using `Tutor <https://docs.tutor.overhang.io/>`_ or the
`Open edX devstack <https://github.com/openedx/devstack/>`_.
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to move this step above the PR step? it seems like testing locally is something that should happen before PRing, but the listed command won't work pre-PR

Comment on lines 127 to 129
7. Run the ``OPENEDX_ATLAS_PULL=true make pull_translations`` to verify that it pulls the translations from the
`openedx-translations repo`_ into ``conf/locale`` directory. Depending on the repo
``make static``/``make static.dev`` is usually needed to generate the JavaScript translation files.
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to move this step above the PR step? it seems like testing locally is something that should happen before PRing, but the listed command won't work pre-PR

source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
@OmarIthawi
Copy link
Member Author

OmarIthawi commented Sep 5, 2023

@brian-smith-tcril Thanks a lot for the review and suggestions. It's much better now.

I've tried to address all review comments and I've added inline TODOs where I intend to make further PRs.

This PR is ready for another review/merge.

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 wonderful! I left a couple comments with tiny nitpicks but this is 99% good to go!

I also left one comment in there with a suggestion that might make it so people don't need to scroll up and down as much, but I wouldn't consider that a blocker for merging this.

source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
Comment on lines +132 to +108
#. Run ``OPENEDX_ATLAS_PULL=true make pull_translations`` to verify translations are pulled from the
`openedx-translations repo`_ into the ``conf/locale`` directory. To generate JavaScript translation files you will
likely also need to run ``make static``/``make static.dev``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Variations of this exist in all 3 types of repo instructions. Maybe it makes sense to move it down into the debugging section instead of having people scroll down and then back up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point @brian-smith-tcril, but I'm reluctant to merge them.

The three variations would may end up in a large item with 3-bullet points which is slightly more complicated than scrolling up and down.

I'd like to keep it as-is and we can iterate later.

source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
source/developers/how-tos/enable-translations-new-repo.rst Outdated Show resolved Hide resolved
@feanil feanil self-requested a review September 7, 2023 17:35
Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

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

I spotted a couple of structural issues in my review that I think should be changed, but I did not thoroughly review the content.

Comment on lines 19 to 45
============
Introduction
============


The `OEP-58 - Translations Management`_ proposal introduced new workflows and tooling to the Open edX translation
management:

- Created the new `openedx-translations project`_ in Transifex.
- Created the new `openedx-translations repo`_ in GitHub.
- Setup two-way links between the Transifex project and the GitHub repo via the
`Transifex GitHub app <https://github.com/apps/transifex-integration>`_.
- Added new the `atlas <https://github.com/openedx/openedx-atlas>`_ command line tool to pull translations which will
be used in the repo Makefiles, build and deploy processes to fetch translations from the
`openedx-translations repo`_.

After configuring the repo as shown in the sections below, the translations workflow will automatically:

- Add the extracted source (English) translation files from the repository you added to the
`openedx-translations repo`_ in GitHub.
- Create a new Transifex resource for your repo in the `openedx-translations project`_ in Transifex.
- Add the translations (Arabic, French, etc) to the GitHub `openedx-translations repo`_ when translation entries are
updated by translators.

The full background and rationale for the new workflows and tooling can be found in the
`OEP-58 - Translations Management`_ docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

This section is useful context but I think belongs in a concepts doc probably one titled Translation Technology and Process. Then I think you could add a link to that in a ..seealso section of this document.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed this section and focused on the How-to part.

This section is a summary of the OEP-58 document. So if we're aiming for brevity, a link should suffice.

I have the habit of summerization from the time that I used to write some academic research.

The full background and rationale for the new workflows and tooling can be found in the
`OEP-58 - Translations Management`_ docs.

The next sections cover the steps to enable translations on a new repo depending its type:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need this line.


TODO: How to enable translations infrastructure on a Python repo
==========
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the heading structure describe in the Documentation quick-reference instead of using double headings. https://docs.openedx.org/en/latest/documentors/references/quick_reference_rst.html#headings

#. For existing repos which don't have the ``make extract_translations`` command, it can be copied from the
`edx-cookiecutters`_ Makefile in the corresponding template e.g. ``cookiecutter-xblock`` Makefile for XBlocks.

**Note:** Some repositories use ``django-manage makemessages``. The recommendation is to use ``i18n_tool extract``
Copy link
Contributor

Choose a reason for hiding this comment

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

#. If you are creating a new repository, use the `cookiecutter-django-ida`_
template.

**TODO:** How to enable translations infrastructure on a Django microservice
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this todo still relevant? Seems like you answer it below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it needs expansion and I'll follow up in other PRs.

@OmarIthawi OmarIthawi requested a review from feanil September 9, 2023 13:30
@OmarIthawi
Copy link
Member Author

@feanil thanks for the comments. The PR is ready for another review.

Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

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

One last change and then it looks good to me from a syntax and structure perspective.


TODO: How to enable translations infrastructure on a Python repo
Quickstart
*********
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
*********
**********

Needs to match the length.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done @feanil!

document the new translation workflow

This contribution is part of the [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) which is sparked by the [Translation Infrastructure update OEP-58](https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification).
@OmarIthawi
Copy link
Member Author

OmarIthawi commented Sep 13, 2023

@brian-smith-tcril would you mind checking if it's ready to merge?

So I can start merging adding the other sections.

@feanil
Copy link
Contributor

feanil commented Sep 13, 2023

@brian-smith-tcril feel free to merge yourself once you think this is good.

@brian-smith-tcril brian-smith-tcril merged commit 5e5387a into openedx:oep-58-howto Sep 18, 2023
@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.

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.

4 participants