Skip to content

Commit c9e9260

Browse files
committed
Merge pull request #815 from artfwo/raster-minmax-label-fix
Untranslatable strings and formatting of the raster min/max label
2 parents f5ca533 + 45c5a8c commit c9e9260

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/core/raster/qgsrasterrenderer.cpp

+18-15
Original file line numberDiff line numberDiff line change
@@ -191,45 +191,48 @@ QString QgsRasterRenderer::minMaxOriginLabel( int theOrigin )
191191
return tr( "User defined" );
192192
}
193193

194-
QString name;
194+
QString label;
195+
QString est_exact;
196+
QString values;
197+
QString extent;
198+
195199
if ( theOrigin & MinMaxEstimated )
196200
{
197-
name += tr( "Estimated" );
201+
est_exact = tr( "Estimated" );
198202
}
199203
else if ( theOrigin & MinMaxExact )
200204
{
201-
name += tr( "Exact" );
205+
est_exact = tr( "Exact" );
202206
}
203207

204-
name += " ";
205-
206208
if ( theOrigin & MinMaxMinMax )
207209
{
208-
name += tr( "min / max" );
210+
values = tr( "min / max" );
209211
}
210212
else if ( theOrigin & MinMaxCumulativeCut )
211213
{
212-
name += "cumulative cut";
214+
values = tr( "cumulative cut" );
213215
}
214216
else if ( theOrigin & MinMaxStdDev )
215217
{
216-
name += "standard deviation";
218+
values = tr( "standard deviation" );
217219
}
218220

219-
name += " " + tr( " of " ) + " ";
220-
221221
if ( theOrigin & MinMaxFullExtent )
222222
{
223-
name += "full extent";
223+
extent = tr( "full extent" );
224224
}
225225
else if ( theOrigin & MinMaxSubExtent )
226226
{
227-
name += "sub extent";
227+
extent = tr( "sub extent" );
228228
}
229229

230-
name += ".";
231-
232-
return name;
230+
label = tr( "%1 %2 of %3.",
231+
"min/max origin label in raster properties, where %1 - estimated/exact, %2 - values (min/max, stddev, etc.), %3 - extent" )
232+
.arg(est_exact)
233+
.arg(values)
234+
.arg(extent);
235+
return label;
233236
}
234237

235238
int QgsRasterRenderer::minMaxOriginFromName( QString theName )

0 commit comments

Comments
 (0)