Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update the directory we run compilemessages in (#3906)
* run the compilemessages command from the locale directory

* update invoke task for compilemessages so that it runs in the locale directory

* incomplete changes to tasks.py for compilemessages
  • Loading branch information
Christopher DeCairos authored and Pomax committed Nov 14, 2019
1 parent 3d6fb49 commit 3abda68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bin/post_compile
Expand Up @@ -33,5 +33,8 @@ LD_LIBRARY_PATH=$BUILD_DIR/gettext/lib:$LD_LIBRARY_PATH
ptSource=$BUILD_DIR/network-api/locale/pt_BR/LC_MESSAGES/django.po
[[ -e $ptSource ]] && cp $ptSource $BUILD_DIR/network-api/locale/pt/LC_MESSAGES/django.po

# Change to the locale directory so that we only process our .po files
cd ./network-api/locale/

# Compile localized strings
python $BUILD_DIR/network-api/manage.py compilemessages
9 changes: 6 additions & 3 deletions tasks.py
Expand Up @@ -9,6 +9,7 @@
os.environ.pop('__PYVENV_LAUNCHER__', None)

ROOT = os.path.dirname(os.path.realpath(__file__))
LOCALE_DIR = os.path.realpath(os.path.abspath('network-api/locale'))

# Python commands's outputs are not rendering properly. Setting pty for *Nix system and
# "PYTHONUNBUFFERED" env var for Windows at True.
Expand Down Expand Up @@ -103,7 +104,8 @@ def makemessages(ctx):
def compilemessages(ctx):
"""Compile the latest translations"""
copy("network-api/locale/pt_BR/LC_MESSAGES/django.po", "network-api/locale/pt/LC_MESSAGES/django.po")
manage(ctx, "compilemessages")
with ctx.cd(LOCALE_DIR):
manage(ctx, "compilemessages")


@task
Expand Down Expand Up @@ -250,7 +252,8 @@ def docker_makemessages(ctx):
def docker_compilemessages(ctx):
"""Compile the latest translations"""
copy("network-api/locale/pt_BR/LC_MESSAGES/django.po", "network-api/locale/pt/LC_MESSAGES/django.po")
docker_manage(ctx, "compilemessages")
with ctx.cd(LOCALE_DIR):
manage(ctx, "compilemessages")


@task
Expand Down Expand Up @@ -291,7 +294,7 @@ def docker_catch_up(ctx):
ctx.run("docker-compose build")
print("* Applying database migrations.")
docker_migrate(ctx)
print("* Compiling localse strings.")
print("* Compiling locale strings.")
docker_compilemessages
print("* Updating block information.")
docker_l10n_block_inventory(ctx)
Expand Down

0 comments on commit 3abda68

Please sign in to comment.