initial commit

This commit is contained in:
nobohan
2021-07-13 10:39:19 +02:00
commit ca258bc445
32 changed files with 3853 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#!/bin/bash
LRELEASE=$1
LOCALES=$2
for LOCALE in ${LOCALES}
do
echo "Processing: ${LOCALE}.ts"
# Note we don't use pylupdate with qt .pro file approach as it is flakey
# about what is made available.
$LRELEASE i18n/${LOCALE}.ts
done

View File

@@ -0,0 +1,28 @@
#!/bin/bash
QGIS_PREFIX_PATH=/usr/local/qgis-2.0
if [ -n "$1" ]; then
QGIS_PREFIX_PATH=$1
fi
echo ${QGIS_PREFIX_PATH}
export QGIS_PREFIX_PATH=${QGIS_PREFIX_PATH}
export QGIS_PATH=${QGIS_PREFIX_PATH}
export LD_LIBRARY_PATH=${QGIS_PREFIX_PATH}/lib
export PYTHONPATH=${QGIS_PREFIX_PATH}/share/qgis/python:${QGIS_PREFIX_PATH}/share/qgis/python/plugins:${PYTHONPATH}
echo "QGIS PATH: $QGIS_PREFIX_PATH"
export QGIS_DEBUG=0
export QGIS_LOG_FILE=/tmp/inasafe/realtime/logs/qgis.log
export PATH=${QGIS_PREFIX_PATH}/bin:$PATH
echo "This script is intended to be sourced to set up your shell to"
echo "use a QGIS 2.0 built in $QGIS_PREFIX_PATH"
echo
echo "To use it do:"
echo "source $BASH_SOURCE /your/optional/install/path"
echo
echo "Then use the make file supplied here e.g. make guitest"

View File

@@ -0,0 +1,56 @@
#!/bin/bash
LOCALES=$*
# Get newest .py files so we don't update strings unnecessarily
CHANGED_FILES=0
PYTHON_FILES=`find . -regex ".*\(ui\|py\)$" -type f`
for PYTHON_FILE in $PYTHON_FILES
do
CHANGED=$(stat -c %Y $PYTHON_FILE)
if [ ${CHANGED} -gt ${CHANGED_FILES} ]
then
CHANGED_FILES=${CHANGED}
fi
done
# Qt translation stuff
# for .ts file
UPDATE=false
for LOCALE in ${LOCALES}
do
TRANSLATION_FILE="i18n/$LOCALE.ts"
if [ ! -f ${TRANSLATION_FILE} ]
then
# Force translation string collection as we have a new language file
touch ${TRANSLATION_FILE}
UPDATE=true
break
fi
MODIFICATION_TIME=$(stat -c %Y ${TRANSLATION_FILE})
if [ ${CHANGED_FILES} -gt ${MODIFICATION_TIME} ]
then
# Force translation string collection as a .py file has been updated
UPDATE=true
break
fi
done
if [ ${UPDATE} == true ]
# retrieve all python files
then
echo ${PYTHON_FILES}
# update .ts
echo "Please provide translations by editing the translation files below:"
for LOCALE in ${LOCALES}
do
echo "i18n/"${LOCALE}".ts"
# Note we don't use pylupdate with qt .pro file approach as it is flakey
# about what is made available.
pylupdate4 -noobsolete ${PYTHON_FILES} -ts i18n/${LOCALE}.ts
done
else
echo "No need to edit any translation files (.ts) because no python files"
echo "has been updated since the last update translation. "
fi