Skip to content
Permalink
Browse files

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
cadecairos authored and Pomax committed Nov 14, 2019
1 parent 3d6fb49 commit 3abda68f8335a2e08f1fbf6429c0838bf7123855
Showing with 9 additions and 3 deletions.
  1. +3 −0 bin/post_compile
  2. +6 −3 tasks.py
@@ -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,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.
@@ -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
@@ -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
@@ -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)

0 comments on commit 3abda68

Please sign in to comment.
You can’t perform that action at this time.