i18n: document txpush, de-bash
This commit is contained in:
parent
6537a054de
commit
5ebbc00334
54
ci/txpush.sh
54
ci/txpush.sh
@ -1,25 +1,55 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Fetch the Transifex translations for Calamares and incorporate them
|
||||||
|
# into the source tree, adding commits of the different files.
|
||||||
|
|
||||||
# Make sure we can make Transifex and git operations from the Calamares Docker+Jenkins environment.
|
### INITIAL SETUP
|
||||||
cp ~/jenkins-master/.transifexrc ~
|
#
|
||||||
cp ~/jenkins-master/.gitconfig ~
|
# This stuff needs to be done once; in a real CI environment where it
|
||||||
cp -R ~/jenkins-master/.ssh ~
|
# runs regularly in a container, the setup needs to be done when
|
||||||
|
# creating the container.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# cp ~/jenkins-master/.transifexrc ~ # Transifex user settings
|
||||||
|
# cp ~/jenkins-master/.gitconfig ~ # Git config, user settings
|
||||||
|
# cp -R ~/jenkins-master/.ssh ~ # SSH, presumably for github
|
||||||
|
#
|
||||||
|
# cd "$WORKSPACE"
|
||||||
|
# git config --global http.sslVerify false
|
||||||
|
|
||||||
cd "$WORKSPACE"
|
test -f "CMakeLists.txt" || { echo "! Not at Calamares top-level" ; exit 1 ; }
|
||||||
git config --global http.sslVerify false
|
test -f ".tx/config" || { echo "! Not at Calamares top-level" ; exit 1 ; }
|
||||||
|
test -f "calamares.desktop" || { echo "! Not at Calamares top-level" ; exit 1 ; }
|
||||||
|
|
||||||
|
### CREATE TRANSLATIONS
|
||||||
|
#
|
||||||
|
# Use local tools (depending on type of source) to create translation
|
||||||
|
# sources, then push to Transifex
|
||||||
|
|
||||||
export QT_SELECT=5
|
export QT_SELECT=5
|
||||||
lupdate src/ -ts -no-obsolete lang/calamares_en.ts
|
lupdate src/ -ts -no-obsolete lang/calamares_en.ts
|
||||||
|
|
||||||
|
tx push --source --no-interactive -r calamares.calamares-master
|
||||||
|
tx push --no-interactive -r calamares.fdo
|
||||||
|
|
||||||
|
### PYTHON MODULES
|
||||||
|
#
|
||||||
|
# The Python tooling depends on the underlying distro to provide
|
||||||
|
# gettext, and handles two cases:
|
||||||
|
#
|
||||||
|
# - python modules with their own lang/ subdir, for larger translations
|
||||||
|
# - python modules without lang/, which use one shared catalog
|
||||||
|
#
|
||||||
|
|
||||||
# Arch
|
# Arch
|
||||||
# PYGETTEXT=/usr/lib/python3.5/Tools/i18n/pygettext.py
|
# PYGETTEXT=/usr/lib/python3.5/Tools/i18n/pygettext.py
|
||||||
|
|
||||||
# Ubuntu
|
# Ubuntu
|
||||||
PYGETTEXT=pygettext3
|
PYGETTEXT=pygettext3
|
||||||
|
|
||||||
for MODULE_DIR in `find src/modules -maxdepth 1 -mindepth 1 -type d`; do
|
for MODULE_DIR in $(find src/modules -maxdepth 1 -mindepth 1 -type d) ; do
|
||||||
FILES=(${MODULE_DIR}/*.py)
|
FILES=$(find "$MODULE_DIR" -name "*.py" -a -type f)
|
||||||
if [ ${#FILES[@]} -gt 0 ]; then
|
if test -n "$FILES" ; then
|
||||||
MODULE_NAME=$(basename ${MODULE_DIR})
|
MODULE_NAME=$(basename ${MODULE_DIR})
|
||||||
if [ -d ${MODULE_DIR}/lang ]; then
|
if [ -d ${MODULE_DIR}/lang ]; then
|
||||||
${PYGETTEXT} -p ${MODULE_DIR}/lang -d ${MODULE_NAME} ${MODULE_DIR}/*.py
|
${PYGETTEXT} -p ${MODULE_DIR}/lang -d ${MODULE_NAME} ${MODULE_DIR}/*.py
|
||||||
@ -30,7 +60,3 @@ for MODULE_DIR in `find src/modules -maxdepth 1 -mindepth 1 -type d`; do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
tx push --source --no-interactive -r calamares.calamares-master
|
|
||||||
tx push --no-interactive -r calamares.fdo
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user