Skip to content

Commit

Permalink
improve translations of strings with numbers inside
Browse files Browse the repository at this point in the history
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue nextcloud#3776.

Signed-off-by: Valdnet <[email protected]>
Signed-off-by: Rainer Walke <[email protected]>
  • Loading branch information
Valdnet authored and rwalke committed Dec 4, 2024
1 parent 05dad2a commit ed75220
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/userstatusselectormodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,21 +413,21 @@ QString UserStatusSelectorModel::timeDifferenceToString(int differenceSecs) cons
if (minutesLeft == 1) {
return tr("1 minute");
} else {
return tr("%1 minutes").arg(minutesLeft);
return tr("%1 minutes", "", minutesLeft).arg(minutesLeft);
}
} else if (differenceSecs < 60 * 60 * 24) {
const auto hoursLeft = std::ceil(differenceSecs / 60.0 / 60.0);
if (hoursLeft == 1) {
return tr("1 hour");
} else {
return tr("%1 hours").arg(hoursLeft);
return tr("%1 hours", "", hoursLeft).arg(hoursLeft);
}
} else {
const auto daysLeft = std::ceil(differenceSecs / 60.0 / 60.0 / 24.0);
if (daysLeft == 1) {
return tr("1 day");
} else {
return tr("%1 days").arg(daysLeft);
return tr("%1 days", "", daysLeft).arg(daysLeft);
}
}
}
Expand Down

0 comments on commit ed75220

Please sign in to comment.