Skip to content

Commit

Permalink
string translation update:
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
jef committed Dec 26, 2008
1 parent 997c368 commit b62f762
Show file tree
Hide file tree
Showing 86 changed files with 865 additions and 1,050 deletions.
7 changes: 7 additions & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -98,9 +98,16 @@ SET (QGIS_APP_MOC_HDRS
qgsidentifyresults.h
qgslabeldialog.h
qgsludialog.h

qgsmaptoolidentify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolvertexedit.h
qgsmaptooladdfeature.h
qgsmaptooladdisland.h
qgsmaptooladdring.h
qgsmaptoolmovefeature.h
qgsmaptoolselect.h

qgsmeasuretool.h
qgsmeasuredialog.h
qgsnewhttpconnection.h
Expand Down
35 changes: 17 additions & 18 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -471,10 +471,8 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
if ( memuse > 200 ) // cca 4500 x 4500
{
int answer = QMessageBox::warning( 0, tr( "Big image" ),
tr( "To create image " ) + QString::number( width ) + " x "
+ QString::number( height )
+ tr( " requires circa " )
+ QString::number( memuse ) + tr( " MB of memory" ),
tr( "To create image %1 x %2 required circa %3 MB of memory" )
.arg( width ).arg( height ).arg( memuse ),
QMessageBox::Ok, QMessageBox::Abort );

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

if ( myCounterInt > 0 ) myFilters += ";;";
myFilters += myFilter;
Expand Down Expand Up @@ -602,26 +601,26 @@ void QgsComposer::on_mActionExportAsSVG_activated( void )
m->setMessageAsHtml( tr( "<p>The SVG export function in Qgis has several "
"problems due to bugs and deficiencies in the " )
#if QT_VERSION < 0x040300
+ tr( "Qt4 svg code. Of note, text does not "
"appear in the SVG file and there are problems "
"with the map bounding box clipping other items "
"such as the legend or scale bar.</p>" )
+ tr( "Qt4 svg code. Of note, text does not "
"appear in the SVG file and there are problems "
"with the map bounding box clipping other items "
"such as the legend or scale bar.</p>" )
#else
+ tr( "Qt4 svg code. In particular, there are problems "
"with layers not being clipped to the map "
"bounding box.</p>" )
+ tr( "Qt4 svg code. In particular, there are problems "
"with layers not being clipped to the map "
"bounding box.</p>" )
#endif
+ tr( "If you require a vector-based output file from "
"Qgis it is suggested that you try printing "
"to PostScript if the SVG output is not "
"satisfactory."
"</p>" ) );
+ tr( "<p>If you require a vector-based output file from "
"Qgis it is suggested that you try printing "
"to PostScript if the SVG output is not "
"satisfactory."
"</p>" ) );
m->exec();
}
QString myLastUsedFile = myQSettings.value( "/UI/lastSaveAsSvgFile", "qgis.svg" ).toString();
QFileInfo file( myLastUsedFile );
QFileDialog *myQFileDialog = new QFileDialog( this, tr( "Choose a file name to save the map as" ),
file.path(), tr( "SVG Format" ) + " (*.svg *SVG)" );
file.path(), tr( "SVG Format" ) + " (*.svg *.SVG)" );
myQFileDialog->selectFile( file.fileName() );
myQFileDialog->setFileMode( QFileDialog::AnyFile );
myQFileDialog->setAcceptMode( QFileDialog::AcceptSave );
Expand Down
10 changes: 5 additions & 5 deletions src/app/composer/qgscomposerscalebarwidget.cpp
Expand Up @@ -64,7 +64,7 @@ void QgsComposerScaleBarWidget::refreshMapComboBox()
QList<const QgsComposerMap*>::const_iterator mapItemIt = availableMaps.constBegin();
for ( ; mapItemIt != availableMaps.constEnd(); ++mapItemIt )
{
mMapComboBox->addItem( tr( "Map " ) + QString::number(( *mapItemIt )->id() ) );
mMapComboBox->addItem( tr( "Map %1" ).arg(( *mapItemIt )->id() ) );
}
}
}
Expand Down Expand Up @@ -145,7 +145,7 @@ void QgsComposerScaleBarWidget::setGuiElements()
//map combo box
if ( mComposerScaleBar->composerMap() )
{
QString mapText = tr( "Map " ) + mComposerScaleBar->composerMap()->id();
QString mapText = tr( "Map %1" ).arg( mComposerScaleBar->composerMap()->id() );
int itemId = mMapComboBox->findText( mapText );
if ( itemId > 0 )
{
Expand Down Expand Up @@ -289,7 +289,7 @@ void QgsComposerScaleBarWidget::on_mStyleComboBox_currentIndexChanged( const QSt
}
else if ( text == tr( "Double Box" ) )
{
untranslatedStyleName = "Double Box";
untranslatedStyleName = "Double Box";
}
else if ( text == tr( "Line Ticks Middle" ) )
{
Expand All @@ -305,11 +305,11 @@ void QgsComposerScaleBarWidget::on_mStyleComboBox_currentIndexChanged( const QSt
}
else if ( text == tr( "Line Ticks Up" ) )
{
untranslatedStyleName = "Line Ticks Up";
untranslatedStyleName = "Line Ticks Up";
}
else if ( text == tr( "Numeric" ) )
{
untranslatedStyleName = "Numeric";
untranslatedStyleName = "Numeric";
}
mComposerScaleBar->setStyle( untranslatedStyleName );
mComposerScaleBar->update();
Expand Down
6 changes: 3 additions & 3 deletions src/app/legend/qgslegendlayerfile.cpp
Expand Up @@ -277,8 +277,8 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )

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

if ( mySelector->exec() )
{
Expand Down Expand Up @@ -325,7 +325,7 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )

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

case QgsVectorFileWriter::ErrCreateLayer:
Expand Down

0 comments on commit b62f762

Please sign in to comment.