view update_translations @ 248:83bf42767d85 default tip

Update version in sao.js after release issue11852
author Cédric Krier <ced@b2ck.com>
date Tue, 01 Nov 2022 16:39:45 +0100
parents 364fc1aeefaf
children
line wrap: on
line source

#!/bin/sh
set -e
SCRIPTS="$( cd "$(dirname "$0")" ; pwd -P )"
DIR=`mktemp -d --suffix=translations`
cd "${DIR}"
MESSAGE=$1

if [ -z "${MESSAGE}" ]; then
    echo "Missing commit message" >&2
    exit -1
fi

hg clone -q -b default https://hg.tryton.org/tryton-env
hg clone -q ssh://hg@hg.tryton.org/weblate

python3 -m venv --system-site-packages venv
. venv/bin/activate

cd tryton-env
.hooks/link_modules
.hooks/update_requirements
pip3 install -q -r requirements.txt
export PYTHONPATH=trytond:proteus
export TRYTOND_DATABASE_URI=postgresql://

dropdb --if-exists translations >/dev/null
createdb translations

echo "password" > passfile.txt
export TRYTONPASSFILE="passfile.txt"

./trytond/bin/trytond-admin -d translations --all --email admin

psql -q -c "UPDATE ir_module SET state = 'to activate' WHERE name != 'tests'" translations
./trytond/bin/trytond-admin -d translations --all

psql -q -c "UPDATE ir_translation SET value = ''" translations

(cd tryton; python3 setup.py extract_messages) >/dev/null
(cd sao; npm install --silent && ./node_modules/.bin/grunt xgettext) >/dev/null

$SCRIPTS/export_weblate.py -d postgresql:///translations tryton sao ../weblate

hg add -q --cwd ../weblate
hg pull -u -q --cwd ../weblate
hg commit -q -m "${MESSAGE}" --cwd ../weblate
hg push -q --cwd ../weblate

rm -rf "${DIR}"

Repository Layout

/ Tryton top level repositories
modules Modules
public Public repositories
tpf Tryton Foundation repositories
sandbox Sandbox