Skip to content

Commit

Permalink
fix: address bryan's review
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Sep 5, 2023
1 parent bf91ffb commit 42b5608
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions source/developers/how-tos/enable-translations-new-repo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Quickstart

To enable translations on a new repository

- Start from an up-to-date cookiecutter (`frontend-template-application`_ for Microfrontends, `edx-cookiecutters`_ for Python)
- Start from an up-to-date cookiecutter (`frontend-template-application`_ for Microfrontends, `edx-cookiecutters`_
for Python)
- Configure the repository according to the appropriate section later in this document.

============
Expand Down Expand Up @@ -48,7 +49,8 @@ The next sections cover the steps to enable translations on a new repo depending
Python Django Plugins and XBlocks
=================================

To include a non-microservice Python repository (such as XBlock, Open edX plugin, or library) in the translations workflow:
To include a non-microservice Python repository (such as XBlock, Open edX plugin, or library) in the translations
workflow:

1. If you are creating a new repository, use the: `edx-cookiecutters`_ templates
such as ``django-app`` or ``xblock``.
Expand Down Expand Up @@ -94,16 +96,17 @@ To include a non-microservice Python repository (such as XBlock, Open edX plugin

5. Create a pull request in the `openedx-translations repo`_

6. Verify the workflow is syncing the translations properly as described in the Debugging section below.
6. Verify the workflow is syncing the translations properly as described in the :ref:`debugging-translations` section.

7. Install the XBlock or plugin in your local `Tutor`_ or `devstack`_ environment. Run ``OPENEDX_ATLAS_PULL=true make pull_translations`` in
the edx-platform repo to preview the translations.
7. Install the XBlock or plugin in your local `Tutor`_ or `devstack`_ environment. Run
``OPENEDX_ATLAS_PULL=true make pull_translations`` in the edx-platform repo to preview the translations.

================================
Django Microservice Repos (IDAs)
================================

The terms "Microservice" and "Independently Deployable Application (IDA)" are used interchangeably throughout the Open edX project. There are many Django microservices in the Open edX ecosystem, such as
The terms "Microservice" and "Independently Deployable Application (IDA)" are used interchangeably throughout the Open
edX project. There are many Django microservices in the Open edX ecosystem, such as
- `edx-platform`_
- `credentials`_
- `ecommerce`_
Expand All @@ -116,10 +119,11 @@ TODO: How to enable translations infrastructure on a Django microservice

5. Create a pull request in the `openedx-translations repo`_

6. Verify the workflow is syncing the translations properly as described in the Debugging section below.
6. Verify the workflow is syncing the translations properly as described in the :ref:`debugging-translations` section.

7. 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``.
`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``.

===========
React Repos
Expand All @@ -129,29 +133,32 @@ React Repos

TODO: How to enable translations infrastructure on a React repo

4. Run ``make extract_translations``. Verify that it creates``src/i18n/transifex_input.json``. This file should be excluded from the repo via the ``.gitignore`` file.
4. Run ``make extract_translations``. Verify that it creates``src/i18n/transifex_input.json``. This file should be
excluded from the repo via the ``.gitignore`` file.

5. Create a pull request in the `openedx-translations repo`_

6. Verify the workflow is syncing the translations properly as described in the Debugging section below.
6. Verify the workflow is syncing the translations properly as described in the :ref:`debugging-translations` section.

7. Depending on how you deploy the micro-frontend, include the ``pull_translations`` make rule with the
``OPENEDX_ATLAS_PULL`` environment variable set to ``true`` e.g
``$ OPENEDX_ATLAS_PULL=true make pull_translations``.

This command needs to run before ``npm build`` in order to include updated translations in final micro-frontend build.
This command needs to run before ``npm build`` in order to include updated translations in final micro-frontend
build.

===================================================
Debugging the ``openedx-translations`` two-way sync
===================================================
.. _debugging-translations:

After adding the to-be-translated repository `openedx-translations repo`_ verify the following in the next day:
================================
Debugging translations workflows
================================

After adding a repository to the `openedx-translations repo`_ verify the following in the next day:

1. The `extract-translation-source-files.yml`_ GitHub workflow worked successfully and the build passes in the
`openedx-translations GitHub Actions tab`_. If something fails, ask for help in the `#wg-translations`_ Open edX
Slack channel. An example of a successfully generated and merged pull request by the workflow's ``edx-transifex-bot`` is the
`chore - add updated translation source files #615`_
pull request.
Slack channel. An example of a successfully generated and merged pull request by the workflow's
``edx-transifex-bot`` is the `chore - add updated translation source files #615`_ pull request.

2. Verify that the `openedx-translations project`_ has a new resource for the repo.

Expand Down Expand Up @@ -187,3 +194,12 @@ After adding the to-be-translated repository `openedx-translations repo`_ verify

.. _chore - add updated translation source files #615: https://github.com/openedx/openedx-translations/pull/615
.. _Updates for file translations/frontend-app-learning/src/i18n/transifex_input.json in de on branch main #598: https://github.com/openedx/openedx-translations/pull/598


.. _edx-platform: https://github.com/openedx/edx-platform
.. _credentials: https://github.com/openedx/credentials
.. _ecommerce: https://github.com/openedx/ecommerce
.. _course-discovery: https://github.com/openedx/course-discovery

.. _Tutor: https://docs.tutor.overhang.io/
.. _devstack: https://github.com/openedx/devstack/

0 comments on commit 42b5608

Please sign in to comment.