diff --git a/.env.tmpl b/.env.tmpl index 9732596f..10d1364e 100644 --- a/.env.tmpl +++ b/.env.tmpl @@ -16,6 +16,5 @@ AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} AWS_BUCKET_NAME=${AWS_BUCKET_NAME} ANALYTICS=${ANALYTICS} BROKER_URL=${BROKER_URL} -TX_USR=${TX_USR} -TX_PWD=${TX_PWD} +TX_TOKEN=${TX_TOKEN} HTPASSWORDS=${HTPASSWORDS} diff --git a/.tx/config b/.tx/config index c6c0253b..4105fc2d 100644 --- a/.tx/config +++ b/.tx/config @@ -12,3 +12,9 @@ type = PO source_file = /tmp/thinkhazard-database.pot source_lang = en file_filter = /tmp/thinkhazard-database-.po + +[o:gfdrr-labs:p:gfdrr-thinkhazard:r:test--database] +type = PO +source_file = /tmp/thinkhazard-database.pot +source_lang = en +file_filter = /tmp/thinkhazard-database-.po diff --git a/docker-compose.yaml b/docker-compose.yaml index a8b47a9e..29389abe 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -25,8 +25,7 @@ services: - hazardsets:/tmp/hazardsets environment: &env - INI_FILE - - TX_USR - - TX_PWD + - TX_TOKEN - PGHOST - PGPORT - PGUSER_PUBLIC diff --git a/requirements.txt b/requirements.txt index a356e3a3..b9869cdd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ SQLAlchemy<2 alembic asyncio boto3 +chameleon # needed by lingua colorlog geoalchemy2 gunicorn diff --git a/thinkhazard/scripts/tx-init b/thinkhazard/scripts/tx-init index 08c8203b..42ecec42 100755 --- a/thinkhazard/scripts/tx-init +++ b/thinkhazard/scripts/tx-init @@ -2,8 +2,6 @@ cat < ${HOME}/.transifexrc [https://www.transifex.com] -hostname = https://www.transifex.com -username = ${TX_USR} -password = ${TX_PWD} -token = +rest_hostname = https://rest.api.transifex.com +token = ${TX_TOKEN} EOF diff --git a/thinkhazard/scripts/tx-pull-db b/thinkhazard/scripts/tx-pull-db index 2b2f7f38..5626c398 100755 --- a/thinkhazard/scripts/tx-pull-db +++ b/thinkhazard/scripts/tx-pull-db @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/bash -e $(dirname $0)/tx-init -tx pull -s -r gfdrr-thinkhazard.database ${TX_BRANCH:+-b "$TX_BRANCH"} +tx pull --translations --languages=es,fr --resources=gfdrr-thinkhazard.database --force import_l10n -v diff --git a/thinkhazard/scripts/tx-push-db b/thinkhazard/scripts/tx-push-db index 4c98bf34..c6265103 100755 --- a/thinkhazard/scripts/tx-push-db +++ b/thinkhazard/scripts/tx-push-db @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/bash -e $(dirname $0)/tx-init pot-create -c lingua.cfg -o /tmp/thinkhazard-database.pot thinkhazard/dont_remove_me.db-i18n -tx push -s -r gfdrr-thinkhazard.database ${TX_BRANCH:+-b "$TX_BRANCH"} +tx push --source --resources=gfdrr-thinkhazard.database