Skip to content
Permalink
Browse files

[processing] Translate some strings when running gdal algorithms

  • Loading branch information
nyalldawson committed Jan 8, 2021
1 parent 601a9e1 commit 02f861c339bb7443dfc0b31a9463eb8447130488
Showing with 12 additions and 3 deletions.
  1. +12 −3 python/plugins/processing/algs/gdal/GdalUtils.py
@@ -44,6 +44,9 @@
QgsDataSourceUri,
QgsProjUtils,
QgsCoordinateReferenceSystem)

from qgis.PyQt.QtCore import QCoreApplication

from processing.core.ProcessingConfig import ProcessingConfig
from processing.tools.system import isWindows, isMac

@@ -88,14 +91,14 @@ def runGdal(commands, feedback=None):

fused_command = ' '.join([str(c) for c in commands])
QgsMessageLog.logMessage(fused_command, 'Processing', Qgis.Info)
feedback.pushInfo('GDAL command:')
feedback.pushInfo(GdalUtils.tr('GDAL command:'))
feedback.pushCommandInfo(fused_command)
feedback.pushInfo('GDAL command output:')
feedback.pushInfo(GdalUtils.tr('GDAL command output:'))
success = False
retry_count = 0
while not success:
loglines = []
loglines.append('GDAL execution console output')
loglines.append(GdalUtils.tr('GDAL execution console output'))
try:
with subprocess.Popen(
fused_command,
@@ -444,3 +447,9 @@ def gdal_crs_string(crs):

# fallback to proj4 string, stripping out newline characters
return crs.toProj().replace('\n', ' ').replace('\r', ' ')

@classmethod
def tr(cls, string, context=''):
if context == '':
context = cls.__name__
return QCoreApplication.translate(context, string)

0 comments on commit 02f861c

Please sign in to comment.
You can’t perform that action at this time.