2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Unified general phrases for duration.

This commit is contained in:
23rd
2022-03-31 19:45:11 +03:00
committed by John Preston
parent fb750b69e3
commit d9541b6a6e
17 changed files with 61 additions and 153 deletions

View File

@@ -53,8 +53,8 @@ void AutoLockBox::prepare() {
}
const auto minutes = (seconds % 3600);
return (minutes
? tr::lng_passcode_autolock_minutes
: tr::lng_passcode_autolock_hours)(
? tr::lng_minutes
: tr::lng_hours)(
tr::now,
lt_count,
minutes ? (seconds / 60) : (seconds / 3600));

View File

@@ -104,9 +104,9 @@ QString TimeLimitText(size_type limit) {
const auto weeks = (days / 7);
const auto months = (days / 29);
return (months > 0)
? tr::lng_local_storage_limit_months(tr::now, lt_count, months)
? tr::lng_months(tr::now, lt_count, months)
: (limit > 0)
? tr::lng_local_storage_limit_weeks(tr::now, lt_count, weeks)
? tr::lng_weeks(tr::now, lt_count, weeks)
: tr::lng_local_storage_limit_never(tr::now);
}

View File

@@ -131,13 +131,10 @@ void StartPendingReset(
const auto hours = (left / kHour);
const auto minutes = (left / kMinute);
const auto duration = days
? tr::lng_group_call_duration_days(tr::now, lt_count, days)
? tr::lng_days(tr::now, lt_count, days)
: hours
? tr::lng_group_call_duration_hours(tr::now, lt_count, hours)
: tr::lng_group_call_duration_minutes(
tr::now,
lt_count,
minutes);
? tr::lng_hours(tr::now, lt_count, hours)
: tr::lng_minutes(tr::now, lt_count, minutes);
if (const auto strong = weak.data()) {
strong->getDelegate()->show(Ui::MakeInformBox(
tr::lng_cloud_password_reset_later(

View File

@@ -113,16 +113,10 @@ QString SelfDestructionBox::DaysLabel(int days) {
return !days
? QString()
: (days > 364)
? tr::lng_self_destruct_years(tr::now, lt_count, days / 365)
? tr::lng_years(tr::now, lt_count, days / 365)
: (days > 25)
? tr::lng_self_destruct_months(
tr::now,
lt_count,
qMax(days / 30, 1))
: tr::lng_self_destruct_weeks(
tr::now,
lt_count,
qMax(days / 7, 1));
? tr::lng_months(tr::now, lt_count, std::max(days / 30, 1))
: tr::lng_weeks(tr::now, lt_count, std::max(days / 7, 1));
}
void SelfDestructionBox::prepare() {