Handle plural vs. singular cases in PrintView (#47)

This commit is contained in:
Jim Evins
2019-02-19 22:13:24 -05:00
parent ff9188f7e7
commit 6be243d3f9
2 changed files with 25 additions and 2 deletions
+17 -2
View File
@@ -90,8 +90,23 @@ namespace glabels
{
copiesStartSpin->setRange( 1, mModel->frame()->nLabels() );
copiesDescriptionLabel->setText( tr("(Will print a total of %1 items on %2 pages.)")
.arg(mRenderer.nItems()).arg(mRenderer.nPages()) );
if ( mRenderer.nPages() == 1 )
{
if ( mRenderer.nItems() == 1 )
{
copiesDescriptionLabel->setText( tr("(Will print a total of 1 item on 1 page.)") );
}
else
{
copiesDescriptionLabel->setText( tr("(Will print a total of %1 items on 1 page.)")
.arg(mRenderer.nItems()) );
}
}
else
{
copiesDescriptionLabel->setText( tr("(Will print a total of %1 items on %2 pages.)")
.arg(mRenderer.nItems()).arg(mRenderer.nPages()) );
}
pageSpin->setRange( 1, mRenderer.nPages() );
nPagesLabel->setText( QString::number( mRenderer.nPages() ) );
+8
View File
@@ -1921,6 +1921,14 @@
<source>(Will print a total of %1 items on %2 pages.)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(Will print a total of 1 item on 1 page.)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(Will print a total of %1 items on 1 page.)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>glabels::PropertiesView</name>