Skip to content

Commit b62f762

Browse files
author
jef
committed
string translation update:
- collect concatenated strings into one string to get more translation context (foo + tr(" bar ") + baz => tr("%1 bar %2)").arg( foo ).arg( bar) - don't qualify tr(), when not necessary (QObject::tr => tr) - remove QString cast/ctor where not necessary ( QString( tr(...) ) => tr (...) ) - add numerusforms where applicable - fix QgsGrassEdit::setCanvasPrompt (was setCanvasPropmt) and more typos - remove plugin template strings from coordinate capture plugin - add Q_OBJECT to classes using QObject::tr (fixes lupdate warnings) git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9897 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 997c368 commit b62f762

File tree

86 files changed

+865
-1050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+865
-1050
lines changed

src/app/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,16 @@ SET (QGIS_APP_MOC_HDRS
9898
qgsidentifyresults.h
9999
qgslabeldialog.h
100100
qgsludialog.h
101+
101102
qgsmaptoolidentify.h
102103
qgsmaptoolsplitfeatures.h
103104
qgsmaptoolvertexedit.h
105+
qgsmaptooladdfeature.h
106+
qgsmaptooladdisland.h
107+
qgsmaptooladdring.h
108+
qgsmaptoolmovefeature.h
109+
qgsmaptoolselect.h
110+
104111
qgsmeasuretool.h
105112
qgsmeasuredialog.h
106113
qgsnewhttpconnection.h

src/app/composer/qgscomposer.cpp

+17-18
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,8 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
471471
if ( memuse > 200 ) // cca 4500 x 4500
472472
{
473473
int answer = QMessageBox::warning( 0, tr( "Big image" ),
474-
tr( "To create image " ) + QString::number( width ) + " x "
475-
+ QString::number( height )
476-
+ tr( " requires circa " )
477-
+ QString::number( memuse ) + tr( " MB of memory" ),
474+
tr( "To create image %1 x %2 required circa %3 MB of memory" )
475+
.arg( width ).arg( height ).arg( memuse ),
478476
QMessageBox::Ok, QMessageBox::Abort );
479477

480478
raise();
@@ -501,7 +499,8 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
501499
for ( ; myCounterInt < QImageWriter::supportedImageFormats().count(); myCounterInt++ )
502500
{
503501
QString myFormat = QString( QImageWriter::supportedImageFormats().at( myCounterInt ) );
504-
QString myFilter = myFormat + " " + tr( "format" ) + " (*." + myFormat.toLower() + " *." + myFormat.toUpper() + ")";
502+
QString myFilter = tr( "%1 format (*.%2 *.%3)" )
503+
.arg( myFormat ).arg( myFormat.toLower() ).arg( myFormat.toUpper() );
505504

506505
if ( myCounterInt > 0 ) myFilters += ";;";
507506
myFilters += myFilter;
@@ -602,26 +601,26 @@ void QgsComposer::on_mActionExportAsSVG_activated( void )
602601
m->setMessageAsHtml( tr( "<p>The SVG export function in Qgis has several "
603602
"problems due to bugs and deficiencies in the " )
604603
#if QT_VERSION < 0x040300
605-
+ tr( "Qt4 svg code. Of note, text does not "
606-
"appear in the SVG file and there are problems "
607-
"with the map bounding box clipping other items "
608-
"such as the legend or scale bar.</p>" )
604+
+ tr( "Qt4 svg code. Of note, text does not "
605+
"appear in the SVG file and there are problems "
606+
"with the map bounding box clipping other items "
607+
"such as the legend or scale bar.</p>" )
609608
#else
610-
+ tr( "Qt4 svg code. In particular, there are problems "
611-
"with layers not being clipped to the map "
612-
"bounding box.</p>" )
609+
+ tr( "Qt4 svg code. In particular, there are problems "
610+
"with layers not being clipped to the map "
611+
"bounding box.</p>" )
613612
#endif
614-
+ tr( "If you require a vector-based output file from "
615-
"Qgis it is suggested that you try printing "
616-
"to PostScript if the SVG output is not "
617-
"satisfactory."
618-
"</p>" ) );
613+
+ tr( "<p>If you require a vector-based output file from "
614+
"Qgis it is suggested that you try printing "
615+
"to PostScript if the SVG output is not "
616+
"satisfactory."
617+
"</p>" ) );
619618
m->exec();
620619
}
621620
QString myLastUsedFile = myQSettings.value( "/UI/lastSaveAsSvgFile", "qgis.svg" ).toString();
622621
QFileInfo file( myLastUsedFile );
623622
QFileDialog *myQFileDialog = new QFileDialog( this, tr( "Choose a file name to save the map as" ),
624-
file.path(), tr( "SVG Format" ) + " (*.svg *SVG)" );
623+
file.path(), tr( "SVG Format" ) + " (*.svg *.SVG)" );
625624
myQFileDialog->selectFile( file.fileName() );
626625
myQFileDialog->setFileMode( QFileDialog::AnyFile );
627626
myQFileDialog->setAcceptMode( QFileDialog::AcceptSave );

src/app/composer/qgscomposerscalebarwidget.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void QgsComposerScaleBarWidget::refreshMapComboBox()
6464
QList<const QgsComposerMap*>::const_iterator mapItemIt = availableMaps.constBegin();
6565
for ( ; mapItemIt != availableMaps.constEnd(); ++mapItemIt )
6666
{
67-
mMapComboBox->addItem( tr( "Map " ) + QString::number(( *mapItemIt )->id() ) );
67+
mMapComboBox->addItem( tr( "Map %1" ).arg(( *mapItemIt )->id() ) );
6868
}
6969
}
7070
}
@@ -145,7 +145,7 @@ void QgsComposerScaleBarWidget::setGuiElements()
145145
//map combo box
146146
if ( mComposerScaleBar->composerMap() )
147147
{
148-
QString mapText = tr( "Map " ) + mComposerScaleBar->composerMap()->id();
148+
QString mapText = tr( "Map %1" ).arg( mComposerScaleBar->composerMap()->id() );
149149
int itemId = mMapComboBox->findText( mapText );
150150
if ( itemId > 0 )
151151
{
@@ -289,7 +289,7 @@ void QgsComposerScaleBarWidget::on_mStyleComboBox_currentIndexChanged( const QSt
289289
}
290290
else if ( text == tr( "Double Box" ) )
291291
{
292-
untranslatedStyleName = "Double Box";
292+
untranslatedStyleName = "Double Box";
293293
}
294294
else if ( text == tr( "Line Ticks Middle" ) )
295295
{
@@ -305,11 +305,11 @@ void QgsComposerScaleBarWidget::on_mStyleComboBox_currentIndexChanged( const QSt
305305
}
306306
else if ( text == tr( "Line Ticks Up" ) )
307307
{
308-
untranslatedStyleName = "Line Ticks Up";
308+
untranslatedStyleName = "Line Ticks Up";
309309
}
310310
else if ( text == tr( "Numeric" ) )
311311
{
312-
untranslatedStyleName = "Numeric";
312+
untranslatedStyleName = "Numeric";
313313
}
314314
mComposerScaleBar->setStyle( untranslatedStyleName );
315315
mComposerScaleBar->update();

src/app/legend/qgslegendlayerfile.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )
277277

278278
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
279279
mySelector->setSelectedCrsId( destCRS.srsid() );
280-
mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile." ) +
281-
tr( "The data points will be transformed from the layer coordinate reference system." ) );
280+
mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile. "
281+
"The data points will be transformed from the layer coordinate reference system." ) );
282282

283283
if ( mySelector->exec() )
284284
{
@@ -325,7 +325,7 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )
325325

326326
case QgsVectorFileWriter::ErrCreateDataSource:
327327
QMessageBox::warning( 0, tr( "Error creating shapefile" ),
328-
tr( "The shapefile could not be created (" ) + shapefileName + ")" );
328+
tr( "The shapefile could not be created (%1)" ).arg( shapefileName ) );
329329
break;
330330

331331
case QgsVectorFileWriter::ErrCreateLayer:

0 commit comments

Comments
 (0)