diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-04 15:30:59 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-05 10:14:25 -0800 |
commit | e453525afb921318b97f04af61da204ecaa41117 (patch) | |
tree | d5a89f64f98bcd1c37794a9e9a82e26047bb5cf5 /commands | |
parent | e114522a44d67e03a2fa13e19c84a74cf5afca6d (diff) | |
download | subsurface-e453525afb921318b97f04af61da204ecaa41117.tar.gz |
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>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/command_edit.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 2ca13199d..701da3ee1 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -87,8 +87,9 @@ bool EditBase<T>::workToBeDone() // Create a text for the menu entry. In the case of multiple dives add the number size_t num_dives = dives.size(); - if (num_dives > 0) - //: remove the part in parentheses for %n = 1 + if (num_dives == 1) + setText(tr("Edit %1").arg(fieldName())); + else if (num_dives > 0) setText(tr("Edit %1 (%n dive(s))", "", num_dives).arg(fieldName())); 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 size_t num_dives = dives.size(); - if (num_dives > 0) - //: remove the part in parentheses for %n = 1 + if (num_dives == 1) + setText(tr("Edit %1").arg(fieldName())); + else if (num_dives > 0) setText(tr("Edit %1 (%n dive(s))", "", num_dives).arg(fieldName())); return num_dives != 0; @@ -958,8 +960,10 @@ void ReplanDive::redo() AddWeight::AddWeight(bool currentDiveOnly) : EditDivesBase(currentDiveOnly) { - //: remove the part in parentheses for %n = 1 - setText(tr("Add weight (%n dive(s))", "", dives.size())); + if (dives.size() == 1) + setText(tr("Add weight")); + else + setText(tr("Add weight (%n dive(s))", "", dives.size())); } bool AddWeight::workToBeDone() @@ -1040,8 +1044,10 @@ bool EditWeightBase::workToBeDone() RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) : EditWeightBase(index, currentDiveOnly) { - //: remove the part in parentheses for %n = 1 - setText(tr("Remove weight (%n dive(s))", "", dives.size())); + if (dives.size() == 1) + setText(tr("Remove weight")); + else + setText(tr("Remove weight (%n dive(s))", "", dives.size())); } void RemoveWeight::undo() @@ -1067,8 +1073,10 @@ EditWeight::EditWeight(int index, weightsystem_t wsIn, bool currentDiveOnly) : if (dives.empty()) return; - //: remove the part in parentheses for %n = 1 - setText(tr("Edit weight (%n dive(s))", "", dives.size())); + if (dives.size() == 1) + setText(tr("Edit weight")); + else + setText(tr("Edit weight (%n dive(s))", "", dives.size())); // Try to untranslate the weightsystem name new_ws = clone_weightsystem(wsIn); |