mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[processing] Translate some strings when running gdal algorithms
This commit is contained in:
parent
601a9e1c92
commit
02f861c339
@ -44,6 +44,9 @@ from qgis.core import (Qgis,
|
||||
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 @@ class GdalUtils:
|
||||
|
||||
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 @@ class GdalUtils:
|
||||
|
||||
# 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user