mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-25 00:12:17 -05:00
fix translation string again and improve translation scripts (followup 79a095cb)
This commit is contained in:
parent
4497c035ce
commit
6ed389c8e8
@ -61,7 +61,7 @@ class PrepareAPIDialog(QDialog):
|
||||
os.remove(self._pap_file)
|
||||
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Saving prepared file..."))
|
||||
prepd = self._api.savePrepared(self._pap_file)
|
||||
rslt = self.trUtf8("Error")
|
||||
rslt = self.tr("Error")
|
||||
if prepd:
|
||||
rslt = QCoreApplication.translate("PythonConsole", "Saved")
|
||||
self.ui.label.setText(u'{0} {1}'.format(self.ui.label.text(), rslt))
|
||||
@ -88,6 +88,5 @@ class PrepareAPIDialog(QDialog):
|
||||
self.ui.progressBar.setVisible(False)
|
||||
self.ui.plainTextEdit.setVisible(True)
|
||||
self.ui.plainTextEdit.insertPlainText(err)
|
||||
self.ui.buttonBox.button(QDialogButtonBox.Cancel).setText(
|
||||
self.trUtf8("Done"))
|
||||
self.ui.buttonBox.button(QDialogButtonBox.Cancel).setText(self.tr("Done"))
|
||||
self.adjustSize()
|
||||
|
||||
@ -25,6 +25,7 @@ __copyright__ = '(C) 2015, Victor Olaya'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from qgis.PyQt.QtWidgets import (QWidget,
|
||||
QVBoxLayout,
|
||||
QPushButton,
|
||||
@ -58,7 +59,7 @@ class GdalAlgorithmDialog(AlgorithmDialog):
|
||||
|
||||
self.setMainWidget(GdalParametersPanel(self, alg))
|
||||
|
||||
self.runAsBatchButton = QPushButton(self.tr("Run as Batch Process…"))
|
||||
self.runAsBatchButton = QPushButton(QCoreApplication.translate("AlgorithmDialog", "Run as Batch Process…"))
|
||||
self.runAsBatchButton.clicked.connect(self.runAsBatch)
|
||||
self.buttonBox.addButton(self.runAsBatchButton, QDialogButtonBox.ResetRole) # reset role to ensure left alignment
|
||||
|
||||
|
||||
@ -29,17 +29,14 @@ __revision__ = '$Format:%H$'
|
||||
from pprint import pformat
|
||||
import time
|
||||
|
||||
from qgis.PyQt.QtCore import Qt
|
||||
from qgis.PyQt.QtWidgets import QMessageBox, QApplication, QPushButton, QWidget, QVBoxLayout, QSizePolicy, QDialogButtonBox
|
||||
from qgis.PyQt.QtGui import QCursor, QColor, QPalette
|
||||
from qgis.PyQt.QtCore import QCoreApplication
|
||||
from qgis.PyQt.QtWidgets import QMessageBox, QPushButton, QSizePolicy, QDialogButtonBox
|
||||
from qgis.PyQt.QtGui import QColor, QPalette
|
||||
|
||||
from qgis.core import (QgsProject,
|
||||
QgsApplication,
|
||||
QgsProcessingUtils,
|
||||
QgsMessageLog,
|
||||
QgsProcessingParameterDefinition,
|
||||
QgsProcessingOutputRasterLayer,
|
||||
QgsProcessingOutputVectorLayer,
|
||||
QgsProcessingAlgRunnerTask,
|
||||
QgsProcessingOutputHtml,
|
||||
QgsProcessingParameterVectorDestination,
|
||||
@ -56,16 +53,13 @@ from processing.core.ProcessingResults import resultsList
|
||||
from processing.gui.ParametersPanel import ParametersPanel
|
||||
from processing.gui.BatchAlgorithmDialog import BatchAlgorithmDialog
|
||||
from processing.gui.AlgorithmDialogBase import AlgorithmDialogBase
|
||||
from processing.gui.AlgorithmExecutor import execute, executeIterating
|
||||
from processing.gui.AlgorithmExecutor import executeIterating
|
||||
from processing.gui.Postprocessing import handleAlgorithmResults
|
||||
|
||||
from processing.core.parameters import ParameterRaster
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.parameters import ParameterExtent
|
||||
from processing.core.parameters import ParameterMultipleInput
|
||||
from processing.core.GeoAlgorithm import executeAlgorithm
|
||||
|
||||
from processing.core.outputs import OutputTable
|
||||
|
||||
from processing.tools import dataobjects
|
||||
|
||||
@ -83,7 +77,7 @@ class AlgorithmDialog(AlgorithmDialogBase):
|
||||
self.bar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
||||
self.layout().insertWidget(0, self.bar)
|
||||
|
||||
self.runAsBatchButton = QPushButton(self.tr("Run as Batch Process…"))
|
||||
self.runAsBatchButton = QPushButton(QCoreTranslation.translate("AlgorithmDialog", "Run as Batch Process…"))
|
||||
self.runAsBatchButton.clicked.connect(self.runAsBatch)
|
||||
self.buttonBox.addButton(self.runAsBatchButton, QDialogButtonBox.ResetRole) # reset role to ensure left alignment
|
||||
|
||||
@ -179,7 +173,7 @@ class AlgorithmDialog(AlgorithmDialogBase):
|
||||
if reply == QMessageBox.No:
|
||||
return
|
||||
checkExtentCRS = ProcessingConfig.getSetting(ProcessingConfig.WARN_UNMATCHING_EXTENT_CRS)
|
||||
#TODO
|
||||
# TODO
|
||||
if False and checkExtentCRS and self.checkExtentCRS():
|
||||
reply = QMessageBox.question(self, self.tr("Extent CRS"),
|
||||
self.tr('Extent parameters must use the same CRS as the input layers.\n'
|
||||
|
||||
@ -20,6 +20,7 @@ use Data::Dumper;
|
||||
die "usage: $0 dest.cpp\n" unless @ARGV==1;
|
||||
|
||||
open F, ">$ARGV[0]";
|
||||
binmode(F, ":utf8");
|
||||
|
||||
print F <<EOF;
|
||||
/*
|
||||
|
||||
@ -16,12 +16,14 @@
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
action=$1
|
||||
|
||||
case "$action" in
|
||||
pull|push|update)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "usage: $(basename $0) {pull|{push|update} builddirectory}"
|
||||
echo "usage: $(basename $0) {pull|{push|update} builddirectory [lang...]}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
@ -72,18 +74,30 @@ if ! type tx >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
files=
|
||||
if [ -d "$2" ]; then
|
||||
builddir=$(realpath $2)
|
||||
textcpp=
|
||||
for i in $builddir/src/core/qgsexpression_texts.cpp $builddir/src/core/qgscontexthelp_texts.cpp; do
|
||||
if [ -f $i ]; then
|
||||
textcpp="$textcpp $i"
|
||||
elif [ "$1" != "pull" ]; then
|
||||
elif [ "$action" != "pull" ]; then
|
||||
echo Generated help file $i not found
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
elif [ "$1" != "pull" ]; then
|
||||
shift
|
||||
shift
|
||||
for t in i18n/qgis_*.ts; do
|
||||
for l in "$@"; do
|
||||
if [ "i18n/qgis_$l.ts" = "$t" ]; then
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
files="$files $t"
|
||||
done
|
||||
|
||||
elif [ "$action" != "pull" ]; then
|
||||
echo Build directory not found
|
||||
exit 1
|
||||
fi
|
||||
@ -91,22 +105,28 @@ fi
|
||||
trap cleanup EXIT
|
||||
|
||||
echo Saving translations
|
||||
files="$(find python -name "*.ts") src/plugins/plugin_template/plugingui.cpp src/plugins/plugin_template/plugin.cpp"
|
||||
[ $1 = push ] && files="$files i18n/qgis_*.ts"
|
||||
files="$files $(find python -name "*.ts") src/plugins/plugin_template/plugingui.cpp src/plugins/plugin_template/plugin.cpp"
|
||||
[ $action = push ] && files="$files i18n/qgis_*.ts"
|
||||
tar --remove-files -cf i18n/backup.tar $files
|
||||
|
||||
if [ $1 = push ]; then
|
||||
if [ $action = push ]; then
|
||||
echo Pulling source from transifex...
|
||||
tx pull -s -l none
|
||||
if ! [ -f "i18n/qgis_en.ts" ]; then
|
||||
echo Download of source translation failed
|
||||
exit
|
||||
fi
|
||||
elif [ $1 = pull ]; then
|
||||
elif [ $action = pull ]; then
|
||||
rm i18n/qgis_*.ts
|
||||
|
||||
echo Pulling new translations...
|
||||
tx pull -a -s --minimum-perc=35
|
||||
shift
|
||||
if [ "$#" -gt 0 ]; then
|
||||
o="-l $@"
|
||||
else
|
||||
o="-a"
|
||||
fi
|
||||
tx pull $o -s --minimum-perc=35
|
||||
fi
|
||||
|
||||
echo Updating python translations
|
||||
@ -147,7 +167,7 @@ $LUPDATE -locations absolute -verbose qgis_ts.pro
|
||||
|
||||
perl -i.bak -ne 'print unless /^\s+<location.*qgs(expression|contexthelp)_texts\.cpp.*$/;' i18n/qgis_*.ts
|
||||
|
||||
if [ $1 = push ]; then
|
||||
if [ $action = push ]; then
|
||||
echo Pushing translation...
|
||||
tx push -s
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user