mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	update_ts.sh: don't update ts files on pull w/o build directory
This commit is contained in:
		
							parent
							
								
									b837e65662
								
							
						
					
					
						commit
						58d59e463c
					
				@ -151,17 +151,18 @@ elif [ $action = pull ]; then
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo Updating python translations
 | 
			
		||||
(
 | 
			
		||||
	cd python
 | 
			
		||||
	mkdir -p tmp
 | 
			
		||||
	pylupdate5 user.py utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts
 | 
			
		||||
	perl ../scripts/ts2ui.pl python-i18n.ts tmp
 | 
			
		||||
	rm python-i18n.ts
 | 
			
		||||
)
 | 
			
		||||
for i in python/plugins/*/CMakeLists.txt; do
 | 
			
		||||
	cd ${i%/*}
 | 
			
		||||
	cat <<EOF >python-i18n.pro
 | 
			
		||||
if [ -d "$builddir" ]; then
 | 
			
		||||
	echo Updating python translations
 | 
			
		||||
	(
 | 
			
		||||
		cd python
 | 
			
		||||
		mkdir -p tmp
 | 
			
		||||
		pylupdate5 user.py utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts
 | 
			
		||||
		perl ../scripts/ts2ui.pl python-i18n.ts tmp
 | 
			
		||||
		rm python-i18n.ts
 | 
			
		||||
	)
 | 
			
		||||
	for i in python/plugins/*/CMakeLists.txt; do
 | 
			
		||||
		cd ${i%/*}
 | 
			
		||||
		cat <<EOF >python-i18n.pro
 | 
			
		||||
SOURCES = $(find . -type f -name "*.py" -print | sed -e 's/^/  /' -e 's/$/ \\/')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -171,34 +172,35 @@ FORMS = $(find . -type f -name "*.ui" -print | sed -e 's/^/  /' -e 's/$/ \\/')
 | 
			
		||||
TRANSLATIONS = python-i18n.ts
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
	pylupdate5 -tr-function trAlgorithm python-i18n.pro
 | 
			
		||||
	mkdir -p tmp
 | 
			
		||||
	perl ../../../scripts/ts2ui.pl python-i18n.ts tmp
 | 
			
		||||
	rm python-i18n.ts python-i18n.pro
 | 
			
		||||
	cd ../../..
 | 
			
		||||
done
 | 
			
		||||
		pylupdate5 -tr-function trAlgorithm python-i18n.pro
 | 
			
		||||
		mkdir -p tmp
 | 
			
		||||
		perl ../../../scripts/ts2ui.pl python-i18n.ts tmp
 | 
			
		||||
		rm python-i18n.ts python-i18n.pro
 | 
			
		||||
		cd ../../..
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
echo Updating GRASS module translations
 | 
			
		||||
perl scripts/qgm2ui.pl >src/plugins/grass/grasslabels-i18n.ui
 | 
			
		||||
	echo Updating GRASS module translations
 | 
			
		||||
	perl scripts/qgm2ui.pl >src/plugins/grass/grasslabels-i18n.ui
 | 
			
		||||
 | 
			
		||||
echo Updating processing translations
 | 
			
		||||
mkdir -p python/plugins/processing/tmp
 | 
			
		||||
perl scripts/processing2ui.pl python/plugins/processing/tmp
 | 
			
		||||
	echo Updating processing translations
 | 
			
		||||
	mkdir -p python/plugins/processing/tmp
 | 
			
		||||
	perl scripts/processing2ui.pl python/plugins/processing/tmp
 | 
			
		||||
 | 
			
		||||
echo Updating appinfo files
 | 
			
		||||
python3 scripts/appinfo2ui.py >src/app/appinfo-i18n.ui
 | 
			
		||||
	echo Updating appinfo files
 | 
			
		||||
	python3 scripts/appinfo2ui.py >src/app/appinfo-i18n.ui
 | 
			
		||||
 | 
			
		||||
echo Creating qmake project file
 | 
			
		||||
$QMAKE -project -o qgis_ts.pro -nopwd $SRCDIR/src $SRCDIR/python $SRCDIR/i18n $textcpp
 | 
			
		||||
	echo Creating qmake project file
 | 
			
		||||
	$QMAKE -project -o qgis_ts.pro -nopwd $SRCDIR/src $SRCDIR/python $SRCDIR/i18n $textcpp
 | 
			
		||||
 | 
			
		||||
QT_INSTALL_HEADERS=$(qmake -query QT_INSTALL_HEADERS)
 | 
			
		||||
	QT_INSTALL_HEADERS=$(qmake -query QT_INSTALL_HEADERS)
 | 
			
		||||
 | 
			
		||||
echo "TR_EXCLUDE = ${QT_INSTALL_HEADERS%
}/*" >>qgis_ts.pro
 | 
			
		||||
	echo "TR_EXCLUDE = ${QT_INSTALL_HEADERS%
}/*" >>qgis_ts.pro
 | 
			
		||||
 | 
			
		||||
echo Updating translations
 | 
			
		||||
$LUPDATE -no-ui-lines -no-obsolete -locations absolute -verbose qgis_ts.pro
 | 
			
		||||
	echo Updating translations
 | 
			
		||||
	$LUPDATE -no-ui-lines -no-obsolete -locations absolute -verbose qgis_ts.pro
 | 
			
		||||
 | 
			
		||||
perl -i.bak -ne 'print unless /^\s+<location.*(qgs(expression|contexthelp)_texts\.cpp|-i18n\.(ui|cpp)).*$/;' i18n/qgis_*.ts
 | 
			
		||||
	perl -i.bak -ne 'print unless /^\s+<location.*(qgs(expression|contexthelp)_texts\.cpp|-i18n\.(ui|cpp)).*$/;' i18n/qgis_*.ts
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ $action = push ]; then
 | 
			
		||||
	cp i18n/qgis_en.ts /tmp/qgis_en.ts-uploading
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user