Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

feat: optionally collect JS translations on deploy - #6708

Merged
nadeemshahzad merged 1 commit into
openedx-unsupported:masterfrom
open-craft:mtyaka/SE-5140-collect-js-translations
Apr 6, 2022
Merged

feat: optionally collect JS translations on deploy#6708
nadeemshahzad merged 1 commit into
openedx-unsupported:masterfrom
open-craft:mtyaka/SE-5140-collect-js-translations

Conversation

@mtyaka

@mtyaka mtyaka commented Mar 30, 2022

Copy link
Copy Markdown
Contributor

If the EDXAPP_COMPILE_JSI18N is enabled, this will invoke the compilejsi18n management command when deploying edxapp.

This is useful when you use custom JS translations for example via a theme.

Test instructions:

I set up a sandbox using code from #6679 to automatically install some custom JS translations. These are the relevant ansible vars:

EDXAPP_DEFAULT_SITE_THEME: simple-theme
SIMPLETHEME_ENABLE_DEPLOY: true
EDXAPP_COMPILE_JSI18N: true
EDXAPP_PREPEND_LOCALE_PATHS:
  - "{{ EDXAPP_COMPREHENSIVE_THEME_DIRS[0] }}/simple-theme/i18n/conf/locale"
SIMPLETHEME_I18N_DJANGO:
  - lang: ar
    domain: djangojs
    messages: |
      msgid "Submit"
      msgstr "تقديم YYY"
      msgid "Add a Post"
      msgstr "إضافة منشور ZZZ"
  1. Create an account and log into the sandbox.
  2. Enroll into the Demo course.
  3. Go to https://mtyaka.opencraft.hosting/update_lang/ and switch the language to Arabic (ar).
  4. Go to the forum, click the button to create a new post, and verify that the submit button at the bottom contains the custom translation "تقديم YYY" and that one of the headings on the page says "إضافة منشور ZZZ".
  5. If you have SSH access to the sandbox (213.32.74.79), go to the /edx/app/edxapp/edx-platform folder and run git status. You should see some modified files under lms/static/js/i18n (the files were modified because the compilejsi18n management comment modifies them after collecting JS translations from LOCALE_PATHS).

Sandbox:

Configuration Pull Request

Make sure that the following steps are done before merging:

  • A SRE team member has approved the PR if it is code shared across multiple services and you don't own all of the services.
  • Are you adding any new default values that need to be overridden when this change goes live? If so:
    • Update the appropriate internal repo (be sure to update for all our environments)
    • If you are updating a secure value rather than an internal one, file a SRE ticket with details.
    • Add an entry to the CHANGELOG.
  • If you are making a complicated change, have you performed the proper testing specified on the Ops Ansible Testing Checklist? Adding a new variable does not require the full list (although testing on a sandbox is a great idea to ensure it links with your downstream code changes).
  • Think about how this change will affect Open edX operators. Have you updated the wiki page for the next Open edX release?

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Mar 30, 2022
@openedx-webhooks

openedx-webhooks commented Mar 30, 2022

Copy link
Copy Markdown

Thanks for the pull request, @mtyaka! I've created OSPR-6553 to keep track of it in JIRA, where we prioritize reviews. 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.

@mtyaka
mtyaka force-pushed the mtyaka/SE-5140-collect-js-translations branch 2 times, most recently from c1b2d54 to a3cc64f Compare March 30, 2022 09:10
@natabene

Copy link
Copy Markdown
Contributor

@mtyaka Thank you for your contribution. Please let me know once it is ready for our review.

@mtyaka mtyaka changed the title WIP: feat: optionally collect JS translations on deploy feat: optionally collect JS translations on deploy Mar 31, 2022
@openedx-webhooks openedx-webhooks added needs triage waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. needs triage labels Mar 31, 2022

@farhaanbukhsh farhaanbukhsh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

  • ✅ I tested this: on the sandbox and saw the configuration
  • ✅ I read through the code
  • ❌ I checked for accessibility issues
  • ❌ Includes documentation
  • ❌ I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@mtyaka

mtyaka commented Apr 4, 2022

Copy link
Copy Markdown
Contributor Author

@natabene This is ready for review.

@openedx-webhooks openedx-webhooks added awaiting prioritization and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Apr 5, 2022
@nadeemshahzad

Copy link
Copy Markdown
Contributor

@mtyaka Can you please rebase the PR? thanks

If the EDXAPP_COMPILE_JSI18N is enabled, this will invoke the
compilejsi18n management command when deploying edxapp.

This is useful when you use custom JS translations for example via a
theme.
@mtyaka
mtyaka force-pushed the mtyaka/SE-5140-collect-js-translations branch from a3cc64f to 1fbdc9a Compare April 6, 2022 08:09
@mtyaka

mtyaka commented Apr 6, 2022

Copy link
Copy Markdown
Contributor Author

@nadeemshahzad Thanks for looking at this. I rebased it and resolved the conflicts.

@nadeemshahzad
nadeemshahzad merged commit 371e360 into openedx-unsupported:master Apr 6, 2022
@openedx-webhooks

Copy link
Copy Markdown

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

@0x29a
0x29a deleted the mtyaka/SE-5140-collect-js-translations branch May 3, 2022 14:34
0x29a pushed a commit to open-craft/configuration that referenced this pull request May 4, 2022
…-5140-collect-js-translations

feat: optionally collect JS translations on deploy
(cherry picked from commit 371e360)
0x29a pushed a commit to open-craft/configuration that referenced this pull request May 28, 2022
…-5140-collect-js-translations

feat: optionally collect JS translations on deploy
(cherry picked from commit 371e360)
0x29a pushed a commit to open-craft/configuration that referenced this pull request May 30, 2022
…-5140-collect-js-translations

feat: optionally collect JS translations on deploy
(cherry picked from commit 371e360)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

merged open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants