From dcfe5ca63f18355a7c7779cb77403f680898de51 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Sun, 18 Feb 2018 15:49:19 +0100 Subject: [PATCH] update translation strings --- .../processing/algs/grass7/Grass7Algorithm.py | 4 ++-- .../processing/script/AddScriptFromFileAction.py | 2 +- python/plugins/processing/script/ScriptUtils.py | 4 ++-- src/3d/qgstessellator.cpp | 4 ++-- src/app/main.cpp | 4 ++-- src/app/qgsmeasuretool.cpp | 2 +- src/app/qgsprojectlayergroupdialog.cpp | 2 +- src/core/expression/qgsexpressionfunction.cpp | 2 +- .../qgsrelationreferencefieldformatter.cpp | 10 +++++----- src/core/qgsmapsettings.cpp | 12 ++++++------ src/core/qgsprojectbadlayerhandler.cpp | 4 ++-- .../editorwidgets/core/qgseditorwidgetregistry.cpp | 4 ++-- src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp | 4 ++-- src/providers/wfs/qgswfsshareddata.cpp | 2 +- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/python/plugins/processing/algs/grass7/Grass7Algorithm.py b/python/plugins/processing/algs/grass7/Grass7Algorithm.py index 9916ad541e5..991d90417fa 100644 --- a/python/plugins/processing/algs/grass7/Grass7Algorithm.py +++ b/python/plugins/processing/algs/grass7/Grass7Algorithm.py @@ -479,7 +479,7 @@ class Grass7Algorithm(QgsProcessingAlgorithm): # Add the default parameters commands self.commands.append(command) - QgsMessageLog.logMessage('processInputs end. Commands: {}'.format(self.commands), 'Grass7', Qgis.Info) + QgsMessageLog.logMessage(self.tr('processInputs end. Commands: {}').format(self.commands), 'Grass7', Qgis.Info) def processCommand(self, parameters, context, delOutputs=False): """ @@ -611,7 +611,7 @@ class Grass7Algorithm(QgsProcessingAlgorithm): command += ' --overwrite' self.commands.append(command) - QgsMessageLog.logMessage('processCommands end. Commands: {}'.format(self.commands), 'Grass7', Qgis.Info) + QgsMessageLog.logMessage(self.tr('processCommands end. Commands: {}').format(self.commands), 'Grass7', Qgis.Info) def vectorOutputType(self, parameters, context): """Determine vector output types for outputs""" diff --git a/python/plugins/processing/script/AddScriptFromFileAction.py b/python/plugins/processing/script/AddScriptFromFileAction.py index 130398927b9..732fb2b8143 100644 --- a/python/plugins/processing/script/AddScriptFromFileAction.py +++ b/python/plugins/processing/script/AddScriptFromFileAction.py @@ -59,7 +59,7 @@ class AddScriptFromFileAction(ToolboxAction): shutil.copy(f, ScriptUtils.scriptsFolders()[0]) valid += 1 except OSError as e: - QgsMessageLog.logMessage("Could not copy script '{}'\n{}".format(f, str(e)), + QgsMessageLog.logMessage(self.tr("Could not copy script '{}'\n{}").format(f, str(e)), "Processing", Qgis.Warning) diff --git a/python/plugins/processing/script/ScriptUtils.py b/python/plugins/processing/script/ScriptUtils.py index dae22ba6111..4f85f6addb5 100644 --- a/python/plugins/processing/script/ScriptUtils.py +++ b/python/plugins/processing/script/ScriptUtils.py @@ -72,8 +72,8 @@ def loadAlgorithm(moduleName, filePath): scriptsRegistry[x] = filePath return obj() except ImportError as e: - QgsMessageLog.logMessage("Could not import script algorithm '{}' from '{}'\n{}".format(moduleName, filePath, str(e)), - "Processing", + QgsMessageLog.logMessage(QCoreApplication.translate("ScriptUtils", "Could not import script algorithm '{}' from '{}'\n{}").format(moduleName, filePath, str(e)), + QCoreApplication.translate("ScriptUtils", "Processing"), Qgis.Critical) diff --git a/src/3d/qgstessellator.cpp b/src/3d/qgstessellator.cpp index 8fe4a5617c5..0b47d848bb1 100644 --- a/src/3d/qgstessellator.cpp +++ b/src/3d/qgstessellator.cpp @@ -405,7 +405,7 @@ void QgsTessellator::addPolygon( const QgsPolygon &polygon, float extrusionHeigh { // Failed to fix that. It could be a really tiny geometry... or maybe they gave us // geometry in unprojected lat/lon coordinates - QgsMessageLog::logMessage( "geometry's coordinates are too close to each other and simplification failed - skipping", "3D" ); + QgsMessageLog::logMessage( QObject::tr( "geometry's coordinates are too close to each other and simplification failed - skipping" ), QObject::tr( "3D" ) ); return; } else @@ -417,7 +417,7 @@ void QgsTessellator::addPolygon( const QgsPolygon &polygon, float extrusionHeigh if ( !_check_intersecting_rings( *polygonNew.get() ) ) { // skip the polygon - it would cause a crash inside poly2tri library - QgsMessageLog::logMessage( "polygon rings intersect each other - skipping", "3D" ); + QgsMessageLog::logMessage( QObject::tr( "polygon rings intersect each other - skipping" ), QObject::tr( "3D" ) ); return; } diff --git a/src/app/main.cpp b/src/app/main.cpp index 0ee9519a327..3617a7e0da3 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -822,11 +822,11 @@ int main( int argc, char *argv[] ) { if ( ! QgsSettings::setGlobalSettingsPath( globalsettingsfile ) ) { - QgsMessageLog::logMessage( QStringLiteral( "Invalid globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Invalid globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" ) ); } else { - QgsMessageLog::logMessage( QStringLiteral( "Successfully loaded globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Successfully loaded globalsettingsfile path: %1" ).arg( globalsettingsfile ), QStringLiteral( "QGIS" ) ); } } diff --git a/src/app/qgsmeasuretool.cpp b/src/app/qgsmeasuretool.cpp index ce5488fd14f..01b2a2bd2b8 100644 --- a/src/app/qgsmeasuretool.cpp +++ b/src/app/qgsmeasuretool.cpp @@ -152,7 +152,7 @@ void QgsMeasureTool::updateSettings() } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught at the MeasureTool: %1" ).arg( cse.what() ) ); + QgsMessageLog::logMessage( tr( "Transform error caught at the MeasureTool: %1" ).arg( cse.what() ) ); } } diff --git a/src/app/qgsprojectlayergroupdialog.cpp b/src/app/qgsprojectlayergroupdialog.cpp index 336743455d2..c912088ee7d 100644 --- a/src/app/qgsprojectlayergroupdialog.cpp +++ b/src/app/qgsprojectlayergroupdialog.cpp @@ -149,7 +149,7 @@ void QgsProjectLayerGroupDialog::changeProjectFile() //check we are not embedding from/to the same project if ( mProjectFileLineEdit->isVisible() && mProjectFileLineEdit->text() == QgsProject::instance()->fileName() ) { - QMessageBox::critical( nullptr, tr( "Embed Layers and Groups" ), tr( "Recursive embedding is not allowed. It is not possible to embed layers / groups from the current project." ) ); + QMessageBox::critical( nullptr, tr( "Embed Layers and Groups" ), tr( "Recursive embedding is not supported. It is not possible to embed layers / groups from the current project." ) ); return; } diff --git a/src/core/expression/qgsexpressionfunction.cpp b/src/core/expression/qgsexpressionfunction.cpp index c4f0fbb0afc..996d094fa8d 100644 --- a/src/core/expression/qgsexpressionfunction.cpp +++ b/src/core/expression/qgsexpressionfunction.cpp @@ -3391,7 +3391,7 @@ static QVariant fcnTransformGeometry( const QVariantList &values, const QgsExpre } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught in transform() function: %1" ).arg( cse.what() ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught in transform() function: %1" ).arg( cse.what() ) ); return QVariant(); } return QVariant(); diff --git a/src/core/fieldformatter/qgsrelationreferencefieldformatter.cpp b/src/core/fieldformatter/qgsrelationreferencefieldformatter.cpp index adbeb7b1329..500d5c2a032 100644 --- a/src/core/fieldformatter/qgsrelationreferencefieldformatter.cpp +++ b/src/core/fieldformatter/qgsrelationreferencefieldformatter.cpp @@ -34,31 +34,31 @@ QString QgsRelationReferenceFieldFormatter::representValue( QgsVectorLayer *laye // Some sanity checks if ( !config.contains( QStringLiteral( "Relation" ) ) ) { - QgsMessageLog::logMessage( QStringLiteral( "Missing Relation in configuration" ) ); + QgsMessageLog::logMessage( QObject::tr( "Missing Relation in configuration" ) ); return value.toString(); } QgsRelation relation = QgsProject::instance()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ); if ( !relation.isValid() ) { - QgsMessageLog::logMessage( QStringLiteral( "Invalid relation" ) ); + QgsMessageLog::logMessage( QObject::tr( "Invalid relation" ) ); return value.toString(); } QgsVectorLayer *referencingLayer = relation.referencingLayer(); if ( layer != referencingLayer ) { - QgsMessageLog::logMessage( QStringLiteral( "representValue() with inconsistent layer parameter w.r.t relation referencingLayer" ) ); + QgsMessageLog::logMessage( QObject::tr( "representValue() with inconsistent layer parameter w.r.t relation referencingLayer" ) ); return value.toString(); } int referencingFieldIdx = referencingLayer->fields().lookupField( relation.fieldPairs().at( 0 ).first ); if ( referencingFieldIdx != fieldIndex ) { - QgsMessageLog::logMessage( QStringLiteral( "representValue() with inconsistent fieldIndex parameter w.r.t relation referencingFieldIdx" ) ); + QgsMessageLog::logMessage( QObject::tr( "representValue() with inconsistent fieldIndex parameter w.r.t relation referencingFieldIdx" ) ); return value.toString(); } QgsVectorLayer *referencedLayer = relation.referencedLayer(); if ( !referencedLayer ) { - QgsMessageLog::logMessage( QStringLiteral( "Cannot find referenced layer" ) ); + QgsMessageLog::logMessage( QObject::tr( "Cannot find referenced layer" ) ); return value.toString(); } diff --git a/src/core/qgsmapsettings.cpp b/src/core/qgsmapsettings.cpp index a340cb34829..ca216127236 100644 --- a/src/core/qgsmapsettings.cpp +++ b/src/core/qgsmapsettings.cpp @@ -414,7 +414,7 @@ QgsRectangle QgsMapSettings::layerExtentToOutputExtent( const QgsMapLayer *layer } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught: %1" ).arg( cse.what() ), QStringLiteral( "CRS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) ); } QgsDebugMsgLevel( QString( "proj extent = " + extent.toString() ), 3 ); @@ -438,7 +438,7 @@ QgsRectangle QgsMapSettings::outputExtentToLayerExtent( const QgsMapLayer *layer } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught: %1" ).arg( cse.what() ), QStringLiteral( "CRS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) ); } QgsDebugMsgLevel( QString( "proj extent = " + extent.toString() ), 3 ); @@ -457,7 +457,7 @@ QgsPointXY QgsMapSettings::layerToMapCoordinates( const QgsMapLayer *layer, QgsP } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught: %1" ).arg( cse.what() ), QStringLiteral( "CRS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) ); } return point; @@ -474,7 +474,7 @@ QgsRectangle QgsMapSettings::layerToMapCoordinates( const QgsMapLayer *layer, Qg } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught: %1" ).arg( cse.what() ), QStringLiteral( "CRS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) ); } return rect; @@ -491,7 +491,7 @@ QgsPointXY QgsMapSettings::mapToLayerCoordinates( const QgsMapLayer *layer, QgsP } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught: %1" ).arg( cse.what() ), QStringLiteral( "CRS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) ); } return point; @@ -508,7 +508,7 @@ QgsRectangle QgsMapSettings::mapToLayerCoordinates( const QgsMapLayer *layer, Qg } catch ( QgsCsException &cse ) { - QgsMessageLog::logMessage( QStringLiteral( "Transform error caught: %1" ).arg( cse.what() ), QStringLiteral( "CRS" ) ); + QgsMessageLog::logMessage( QObject::tr( "Transform error caught: %1" ).arg( cse.what() ), QObject::tr( "CRS" ) ); } return rect; diff --git a/src/core/qgsprojectbadlayerhandler.cpp b/src/core/qgsprojectbadlayerhandler.cpp index 7b074092eef..253fccc63cf 100644 --- a/src/core/qgsprojectbadlayerhandler.cpp +++ b/src/core/qgsprojectbadlayerhandler.cpp @@ -22,10 +22,10 @@ void QgsProjectBadLayerHandler::handleBadLayers( const QList &layers ) { - QgsApplication::messageLog()->logMessage( QStringLiteral( "%1 bad layers dismissed:" ).arg( layers.size() ) ); + QgsApplication::messageLog()->logMessage( QObject::tr( "%1 bad layers dismissed:" ).arg( layers.size() ) ); Q_FOREACH ( const QDomNode &layer, layers ) { - QgsApplication::messageLog()->logMessage( QStringLiteral( " * %1" ).arg( dataSource( layer ) ) ); + QgsApplication::messageLog()->logMessage( QObject::tr( " * %1" ).arg( dataSource( layer ) ) ); } } diff --git a/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp b/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp index 77df0d84f06..dfe820de2ae 100644 --- a/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp +++ b/src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp @@ -170,12 +170,12 @@ bool QgsEditorWidgetRegistry::registerWidget( const QString &widgetId, QgsEditor { if ( !widgetFactory ) { - QgsApplication::messageLog()->logMessage( QStringLiteral( "QgsEditorWidgetRegistry: Factory not valid." ) ); + QgsApplication::messageLog()->logMessage( tr( "QgsEditorWidgetRegistry: Factory not valid." ) ); return false; } else if ( mWidgetFactories.contains( widgetId ) ) { - QgsApplication::messageLog()->logMessage( QStringLiteral( "QgsEditorWidgetRegistry: Factory with id %1 already registered." ).arg( widgetId ) ); + QgsApplication::messageLog()->logMessage( tr( "QgsEditorWidgetRegistry: Factory with id %1 already registered." ).arg( widgetId ) ); return false; } else diff --git a/src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp b/src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp index a9c8181d958..fcc64a0c0f9 100644 --- a/src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp +++ b/src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp @@ -59,7 +59,7 @@ void QgsDateTimeEditWrapper::initWidget( QWidget *editor ) if ( !mQDateTimeEdit ) { QgsDebugMsg( "Date/time edit widget could not be initialized because provided widget is not a QDateTimeEdit." ); - QgsMessageLog::logMessage( QStringLiteral( "Date/time edit widget could not be initialized because provided widget is not a QDateTimeEdit." ), QStringLiteral( "UI forms" ), Qgis::Warning ); + QgsMessageLog::logMessage( tr( "Date/time edit widget could not be initialized because provided widget is not a QDateTimeEdit." ), tr( "UI forms" ), Qgis::Warning ); return; } @@ -88,7 +88,7 @@ void QgsDateTimeEditWrapper::initWidget( QWidget *editor ) { QgsApplication::messageLog()->logMessage( tr( "The usual date/time widget QDateTimeEdit cannot be configured to allow NULL values. " "For that the QGIS custom widget QgsDateTimeEdit needs to be used." ), - QStringLiteral( "field widgets" ) ); + tr( "field widgets" ) ); } if ( mQgsDateTimeEdit ) diff --git a/src/providers/wfs/qgswfsshareddata.cpp b/src/providers/wfs/qgswfsshareddata.cpp index d8b12d8cff1..ff6187d61cd 100644 --- a/src/providers/wfs/qgswfsshareddata.cpp +++ b/src/providers/wfs/qgswfsshareddata.cpp @@ -1043,7 +1043,7 @@ void QgsWFSSharedData::endOfDownload( bool success, int featureCount, msg += " " + tr( "Zoom in to fetch all data." ); else msg += " " + tr( "You may want to check the 'Only request features overlapping the view extent' option to be able to zoom in to fetch all data." ); - QgsMessageLog::logMessage( msg, QStringLiteral( "WFS" ) ); + QgsMessageLog::logMessage( msg, tr( "WFS" ) ); } }