Skip to content

Commit

Permalink
refactor: Change where transifex input generates
Browse files Browse the repository at this point in the history
Per feedback in openedx/openedx-translations#1834 this is really just a temp file, so we should treat it as one. Also adding a README to the locale dir to deter people from editing those files.
  • Loading branch information
bmtcril committed Oct 13, 2023
1 parent 6249248 commit f2216b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ __pycache__
/.idea/
venv/
env/
transifex_input.yaml
6 changes: 0 additions & 6 deletions .tx/config

This file was deleted.

7 changes: 4 additions & 3 deletions scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ def extract_translations(root_path):
An English locale file is created, which openedx-translations will send to
Transifex for translation.
"""
translation_file = (
"tutoraspects/templates/aspects/apps/superset/conf/locale/en/locale.yaml"
)
# The expectation is that this will end up at the site root, which should
# be cwd for make targets. This is a temporary file used only in the Github
# action in openedx-translations.
translation_file = "transifex_input.yaml"

print("Gathering text for translations...")
STRINGS = set(get_text_for_translations(root_path))
Expand Down
7 changes: 7 additions & 0 deletions tutoraspects/templates/aspects/apps/superset/conf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Locale Files

These files are managed via the OEP-58 process and should not be manually edited as they will be overwritten. The process is:

1. A Github action on `openedx-translations` will pull this repo and run `make extract-translations` on this repo's Makefile. This pulls all translatable strings from the Superset assets. These are then uploaded to Transifex for translation.
2. As translations are updated in Transifex they will be pushed to the correct language's files in `openedx-translations`.
3. A Github action on this repo will run `make pull-translations` periodically. This will run the Atlas tool to synchronize the translation files in this directory with what is stored in `openedx-translations`. Then it will run a command to compile all of the separate translated files into one `locale.yaml` that is used to create the localized dashboard and chart strings during the Tutor init command. It will then automatically merge those changed files.

0 comments on commit f2216b1

Please sign in to comment.