mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Translation: explicitly show no dive-count if only one dive edited
We relied upon the translators to remove the parenthesis in cases like "Edited notes (%n dives)" for n = 1 dives. Dirk doesn't want that. Therefore, do it in the C++-code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e114522a44
commit
e453525afb
1 changed files with 18 additions and 10 deletions
|
@ -87,8 +87,9 @@ bool EditBase<T>::workToBeDone()
|
||||||
|
|
||||||
// Create a text for the menu entry. In the case of multiple dives add the number
|
// Create a text for the menu entry. In the case of multiple dives add the number
|
||||||
size_t num_dives = dives.size();
|
size_t num_dives = dives.size();
|
||||||
if (num_dives > 0)
|
if (num_dives == 1)
|
||||||
//: remove the part in parentheses for %n = 1
|
setText(tr("Edit %1").arg(fieldName()));
|
||||||
|
else if (num_dives > 0)
|
||||||
setText(tr("Edit %1 (%n dive(s))", "", num_dives).arg(fieldName()));
|
setText(tr("Edit %1 (%n dive(s))", "", num_dives).arg(fieldName()));
|
||||||
|
|
||||||
return num_dives > 0;
|
return num_dives > 0;
|
||||||
|
@ -626,8 +627,9 @@ bool EditTagsBase::workToBeDone()
|
||||||
|
|
||||||
// Create a text for the menu entry. In the case of multiple dives add the number
|
// Create a text for the menu entry. In the case of multiple dives add the number
|
||||||
size_t num_dives = dives.size();
|
size_t num_dives = dives.size();
|
||||||
if (num_dives > 0)
|
if (num_dives == 1)
|
||||||
//: remove the part in parentheses for %n = 1
|
setText(tr("Edit %1").arg(fieldName()));
|
||||||
|
else if (num_dives > 0)
|
||||||
setText(tr("Edit %1 (%n dive(s))", "", num_dives).arg(fieldName()));
|
setText(tr("Edit %1 (%n dive(s))", "", num_dives).arg(fieldName()));
|
||||||
|
|
||||||
return num_dives != 0;
|
return num_dives != 0;
|
||||||
|
@ -958,7 +960,9 @@ void ReplanDive::redo()
|
||||||
AddWeight::AddWeight(bool currentDiveOnly) :
|
AddWeight::AddWeight(bool currentDiveOnly) :
|
||||||
EditDivesBase(currentDiveOnly)
|
EditDivesBase(currentDiveOnly)
|
||||||
{
|
{
|
||||||
//: remove the part in parentheses for %n = 1
|
if (dives.size() == 1)
|
||||||
|
setText(tr("Add weight"));
|
||||||
|
else
|
||||||
setText(tr("Add weight (%n dive(s))", "", dives.size()));
|
setText(tr("Add weight (%n dive(s))", "", dives.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1040,7 +1044,9 @@ bool EditWeightBase::workToBeDone()
|
||||||
RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) :
|
RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) :
|
||||||
EditWeightBase(index, currentDiveOnly)
|
EditWeightBase(index, currentDiveOnly)
|
||||||
{
|
{
|
||||||
//: remove the part in parentheses for %n = 1
|
if (dives.size() == 1)
|
||||||
|
setText(tr("Remove weight"));
|
||||||
|
else
|
||||||
setText(tr("Remove weight (%n dive(s))", "", dives.size()));
|
setText(tr("Remove weight (%n dive(s))", "", dives.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1067,7 +1073,9 @@ EditWeight::EditWeight(int index, weightsystem_t wsIn, bool currentDiveOnly) :
|
||||||
if (dives.empty())
|
if (dives.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//: remove the part in parentheses for %n = 1
|
if (dives.size() == 1)
|
||||||
|
setText(tr("Edit weight"));
|
||||||
|
else
|
||||||
setText(tr("Edit weight (%n dive(s))", "", dives.size()));
|
setText(tr("Edit weight (%n dive(s))", "", dives.size()));
|
||||||
|
|
||||||
// Try to untranslate the weightsystem name
|
// Try to untranslate the weightsystem name
|
||||||
|
|
Loading…
Reference in a new issue