diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index e21f026fa..0229fbcd1 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -84,6 +84,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_calendar_days#one" = "{count} day"; "lng_calendar_days#other" = "{count} days"; +"lng_seconds#one" = "{count} second"; +"lng_seconds#other" = "{count} seconds"; +"lng_minutes#one" = "{count} minute"; +"lng_minutes#other" = "{count} minutes"; +"lng_hours#one" = "{count} hour"; +"lng_hours#other" = "{count} hours"; +"lng_days#one" = "{count} day"; +"lng_days#other" = "{count} days"; +"lng_weeks#one" = "{count} week"; +"lng_weeks#other" = "{count} weeks"; +"lng_months#one" = "{count} month"; +"lng_months#other" = "{count} months"; +"lng_years#one" = "{count} year"; +"lng_years#other" = "{count} years"; + "lng_seconds_tiny#one" = "{count}s"; "lng_seconds_tiny#other" = "{count}s"; "lng_minutes_tiny#one" = "{count}m"; @@ -272,12 +287,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_signin_sure_reset" = "Warning!\n\nYou will lose all your chats and messages, along with any media and files you shared!\n\nDo you want to reset your account?"; "lng_signin_reset" = "Reset"; "lng_signin_reset_wait" = "Since the account {phone_number} is active and protected by a password, we will delete it in 1 week for security purposes. You can cancel this process at any time.\n\nYou’ll be able to reset your account in:\n{when}"; -"lng_signin_reset_days#one" = "{count} day"; -"lng_signin_reset_days#other" = "{count} days"; -"lng_signin_reset_hours#one" = "{count} hour"; -"lng_signin_reset_hours#other" = "{count} hours"; -"lng_signin_reset_minutes#one" = "{count} minute"; -"lng_signin_reset_minutes#other" = "{count} minutes"; "lng_signin_reset_in_days" = "{days_count} {hours_count} {minutes_count}"; "lng_signin_reset_in_hours" = "{hours_count} {minutes_count}"; "lng_signin_reset_cancelled" = "Your recent attempts to reset this account have been cancelled by its active user. Please try again in 7 days."; @@ -603,10 +612,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_local_storage_size_limit" = "Total size limit: {size}"; "lng_local_storage_media_limit" = "Media cache limit: {size}"; "lng_local_storage_time_limit" = "Clear files older than: {limit}"; -"lng_local_storage_limit_weeks#one" = "{count} week"; -"lng_local_storage_limit_weeks#other" = "{count} weeks"; -"lng_local_storage_limit_months#one" = "{count} month"; -"lng_local_storage_limit_months#other" = "{count} months"; "lng_local_storage_limit_never" = "Never"; "lng_local_storage_summary" = "Summary"; "lng_local_storage_clear_some" = "Clear"; @@ -627,10 +632,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_passcode_autolock" = "Auto-Lock"; "lng_passcode_autolock_away" = "Auto-Lock if away for..."; "lng_passcode_autolock_inactive" = "Auto-Lock if inactive for..."; -"lng_passcode_autolock_minutes#one" = "{count} minute"; -"lng_passcode_autolock_minutes#other" = "{count} minutes"; -"lng_passcode_autolock_hours#one" = "{count} hour"; -"lng_passcode_autolock_hours#other" = "{count} hours"; "lng_passcode_autolock_hours_minutes" = "{hours_count}h {minutes_count}m"; "lng_passcode_enter_old" = "Enter current passcode"; "lng_passcode_enter_first" = "Enter a passcode"; @@ -873,12 +874,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_self_destruct_description" = "If you don't come online at least once within this period, your account will be deleted along with all groups, messages and contacts."; "lng_self_destruct_sessions_title" = "Session termination"; "lng_self_destruct_sessions_description" = "If you don't come online from a specific session at least once within this period, it will be terminated."; -"lng_self_destruct_weeks#one" = "{count} week"; -"lng_self_destruct_weeks#other" = "{count} weeks"; -"lng_self_destruct_months#one" = "{count} month"; -"lng_self_destruct_months#other" = "{count} months"; -"lng_self_destruct_years#one" = "{count} year"; -"lng_self_destruct_years#other" = "{count} years"; "lng_change_phone_title" = "Change phone number"; "lng_change_phone_about" = "You can change your Telegram number\nhere. Your account and all your cloud data\n— messages, media, contacts, etc. will be\nmoved to the new number.\n\n**Important**: all your Telegram contacts will\nget your **new number** added to their address\nbook, provided they had your old number and\nyou haven't blocked them in Telegram."; @@ -902,12 +897,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_mute_menu_sound_on" = "Enable sound"; "lng_mute_menu_sound_off" = "Disable sound"; "lng_mute_box_title" = "Mute notifications for..."; -"lng_mute_box_days#one" = "{count} day"; -"lng_mute_box_days#other" = "{count} days"; -"lng_mute_box_hours#one" = "{count} hour"; -"lng_mute_box_hours#other" = "{count} hours"; -"lng_mute_box_minutes#one" = "{count} minute"; -"lng_mute_box_minutes#other" = "{count} minutes"; "lng_mute_duration_hours#one" = "For {count} hour"; "lng_mute_duration_hours#other" = "For {count} hours"; @@ -1136,9 +1125,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_ttl_about_tooltip" = "New messages in this chat will be automatically deleted in {duration}."; "lng_ttl_about_tooltip_channel" = "New messages in this chat will be automatically deleted in {duration}."; "lng_ttl_about_tooltip_off" = "Auto-delete is now disabled."; -"lng_ttl_about_duration1" = "1 day"; -"lng_ttl_about_duration2" = "1 week"; -"lng_ttl_about_duration3" = "1 month"; "lng_report_title" = "Report channel"; "lng_report_group_title" = "Report group"; @@ -1242,8 +1228,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_message_unsupported" = "This message is not supported by your version of Telegram Desktop. Please update to the latest version in Settings, or install it from {link}"; "lng_message_not_found" = "Message doesn't exist."; -"lng_duration_seconds#one" = "{count} second"; -"lng_duration_seconds#other" = "{count} seconds"; "lng_duration_minsec_minutes#one" = "{count} min"; "lng_duration_minsec_minutes#other" = "{count} min"; "lng_duration_minsec_seconds#one" = "{count} sec"; @@ -2368,14 +2352,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_group_call_context_remove" = "Remove"; "lng_group_call_remove_channel" = "Remove {channel} from the voice chat?"; "lng_group_call_remove_channel_from_channel" = "Remove {channel} from the live stream?"; -"lng_group_call_duration_days#one" = "{count} day"; -"lng_group_call_duration_days#other" = "{count} days"; -"lng_group_call_duration_hours#one" = "{count} hour"; -"lng_group_call_duration_hours#other" = "{count} hours"; -"lng_group_call_duration_minutes#one" = "{count} minute"; -"lng_group_call_duration_minutes#other" = "{count} minutes"; -"lng_group_call_duration_seconds#one" = "{count} second"; -"lng_group_call_duration_seconds#other" = "{count} seconds"; "lng_group_call_mac_access" = "Telegram Desktop does not have access to system wide keyboard input required for Push to Talk."; "lng_group_call_mac_input" = "Please allow **Input Monitoring** for Telegram in Privacy Settings."; "lng_group_call_mac_accessibility" = "Please allow **Accessibility** for Telegram in Privacy Settings.\n\nApp restart may be required."; @@ -2608,11 +2584,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_exceptions_list_title" = "Exceptions"; "lng_removed_list_title" = "Removed users"; -"lng_admin_log_slow_mode_seconds#one" = "{count} second"; -"lng_admin_log_slow_mode_seconds#other" = "{count} seconds"; -"lng_admin_log_slow_mode_minutes#one" = "{count} minute"; -"lng_admin_log_slow_mode_minutes#other" = "{count} minutes"; - "lng_admin_log_title_all" = "All actions"; "lng_admin_log_title_selected" = "Selected actions"; "lng_admin_log_filter" = "Filter"; @@ -2974,8 +2945,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_export_invalid" = "Sorry, you have started a new data export, so this data export is now cancelled."; "lng_export_delay" = "Sorry, for security reasons, you will be able to begin downloading your data in {hours}. We have notified all your devices about the export request to make sure it's authorized and to give you time to react if it's not.\n\nPlease come back on {date} and repeat the request using the same device."; "lng_export_delay_less_than_hour" = "less than an hour"; -"lng_export_delay_hours#one" = "{count} hour"; -"lng_export_delay_hours#other" = "{count} hours"; "lng_export_suggest_title" = "Data export ready"; "lng_export_suggest_text" = "You can now download the data you requested. Start exporting data?"; "lng_export_suggest_cancel" = "Not now"; diff --git a/Telegram/SourceFiles/boxes/auto_lock_box.cpp b/Telegram/SourceFiles/boxes/auto_lock_box.cpp index 7edb73c79..49383558e 100644 --- a/Telegram/SourceFiles/boxes/auto_lock_box.cpp +++ b/Telegram/SourceFiles/boxes/auto_lock_box.cpp @@ -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)); diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index 769f5deab..0662da271 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -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); } diff --git a/Telegram/SourceFiles/boxes/passcode_box.cpp b/Telegram/SourceFiles/boxes/passcode_box.cpp index 910eeef33..2c0bbf9b1 100644 --- a/Telegram/SourceFiles/boxes/passcode_box.cpp +++ b/Telegram/SourceFiles/boxes/passcode_box.cpp @@ -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( diff --git a/Telegram/SourceFiles/boxes/self_destruction_box.cpp b/Telegram/SourceFiles/boxes/self_destruction_box.cpp index 2d4b94748..54209c81a 100644 --- a/Telegram/SourceFiles/boxes/self_destruction_box.cpp +++ b/Telegram/SourceFiles/boxes/self_destruction_box.cpp @@ -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() { diff --git a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp index bd9d6cfb0..27a4cd15c 100644 --- a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp +++ b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp @@ -174,20 +174,11 @@ void ScheduleGroupCallBox( const auto now = base::unixtime::now(); const auto duration = (date - now); if (duration >= 24 * 60 * 60) { - return tr::lng_group_call_duration_days( - tr::now, - lt_count, - duration / (24 * 60 * 60)); + return tr::lng_days(tr::now, lt_count, duration / (24 * 60 * 60)); } else if (duration >= 60 * 60) { - return tr::lng_group_call_duration_hours( - tr::now, - lt_count, - duration / (60 * 60)); + return tr::lng_hours(tr::now, lt_count, duration / (60 * 60)); } - return tr::lng_group_call_duration_minutes( - tr::now, - lt_count, - std::max(duration / 60, 1)); + return tr::lng_minutes(tr::now, lt_count, std::max(duration / 60, 1)); }); } diff --git a/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp b/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp index c793114e0..a2828f0a9 100644 --- a/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp +++ b/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp @@ -231,7 +231,7 @@ void PanelController::showError(const ApiErrorState &error) { if (hours <= 0) { return tr::lng_export_delay_less_than_hour(tr::now); } - return tr::lng_export_delay_hours(tr::now, lt_count, hours); + return tr::lng_hours(tr::now, lt_count, hours); }(); showError(tr::lng_export_delay( tr::now, diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp index c795493db..683ee4b26 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_user.h" #include "data/data_session.h" #include "lang/lang_keys.h" +#include "ui/text/format_values.h" #include "ui/text/text_utilities.h" #include "ui/basic_click_handlers.h" #include "boxes/sticker_set_box.h" @@ -1124,14 +1125,8 @@ void GenerateItems( const auto createToggleSlowMode = [&](const LogSlowMode &action) { if (const auto seconds = action.vnew_value().v) { const auto duration = (seconds >= 60) - ? tr::lng_admin_log_slow_mode_minutes( - tr::now, - lt_count, - seconds / 60) - : tr::lng_admin_log_slow_mode_seconds( - tr::now, - lt_count, - seconds); + ? tr::lng_minutes(tr::now, lt_count, seconds / 60) + : tr::lng_seconds(tr::now, lt_count, seconds); const auto text = tr::lng_admin_log_changed_slow_mode( tr::now, lt_from, @@ -1348,11 +1343,7 @@ void GenerateItems( const auto wrap = [](int duration) -> TextWithEntities { const auto text = (duration == 5) ? u"5 seconds"_q - : (duration < 2 * 86400) - ? tr::lng_manage_messages_ttl_after1(tr::now) - : (duration < 8 * 86400) - ? tr::lng_manage_messages_ttl_after2(tr::now) - : tr::lng_manage_messages_ttl_after3(tr::now); + : Ui::FormatTTL(duration); return { .text = text }; }; const auto text = !was diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index 65a08b339..8ec617fdf 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -448,12 +448,12 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) { const auto hours = seconds / 3600; const auto minutes = seconds / 60; auto text = (days > 1) - ? tr::lng_group_call_duration_days(tr::now, lt_count, days) + ? tr::lng_days(tr::now, lt_count, days) : (hours > 1) - ? tr::lng_group_call_duration_hours(tr::now, lt_count, hours) + ? tr::lng_hours(tr::now, lt_count, hours) : (minutes > 1) - ? tr::lng_group_call_duration_minutes(tr::now, lt_count, minutes) - : tr::lng_group_call_duration_seconds(tr::now, lt_count, seconds); + ? tr::lng_minutes(tr::now, lt_count, minutes) + : tr::lng_seconds(tr::now, lt_count, seconds); if (history()->peer->isBroadcast()) { result.text = tr::lng_action_group_call_finished( tr::now, @@ -508,11 +508,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) { const auto period = action.vperiod().v; const auto duration = (period == 5) ? u"5 seconds"_q - : (period < 2 * 86400) - ? tr::lng_ttl_about_duration1(tr::now) - : (period < 8 * 86400) - ? tr::lng_ttl_about_duration2(tr::now) - : tr::lng_ttl_about_duration3(tr::now); + : Ui::FormatTTL(period); if (isPost()) { if (!period) { result.text = tr::lng_action_ttl_removed_channel( diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index 938e327aa..3746e829a 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -518,16 +518,13 @@ void Widget::resetAccount() { const auto days = (seconds + 59) / 86400; const auto hours = ((seconds + 59) % 86400) / 3600; const auto minutes = ((seconds + 59) % 3600) / 60; - auto when = tr::lng_signin_reset_minutes( - tr::now, - lt_count, - minutes); + auto when = tr::lng_minutes(tr::now, lt_count, minutes); if (days > 0) { - const auto daysCount = tr::lng_signin_reset_days( + const auto daysCount = tr::lng_days( tr::now, lt_count, days); - const auto hoursCount = tr::lng_signin_reset_hours( + const auto hoursCount = tr::lng_hours( tr::now, lt_count, hours); @@ -540,7 +537,7 @@ void Widget::resetAccount() { lt_minutes_count, when); } else if (hours > 0) { - const auto hoursCount = tr::lng_signin_reset_hours( + const auto hoursCount = tr::lng_hours( tr::now, lt_count, hours); diff --git a/Telegram/SourceFiles/menu/menu_ttl_validator.cpp b/Telegram/SourceFiles/menu/menu_ttl_validator.cpp index 93779cdb7..75b7ee1db 100644 --- a/Telegram/SourceFiles/menu/menu_ttl_validator.cpp +++ b/Telegram/SourceFiles/menu/menu_ttl_validator.cpp @@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/text/text_utilities.h" #include "ui/toast/toast.h" #include "ui/toasts/common_toasts.h" +#include "ui/text/format_values.h" #include "styles/style_chat.h" #include "styles/style_menu_icons.h" @@ -37,11 +38,7 @@ void ShowAutoDeleteToast( const auto duration = (period == 5) ? u"5 seconds"_q - : (period < 2 * 86400) - ? tr::lng_ttl_about_duration1(tr::now) - : (period < 8 * 86400) - ? tr::lng_ttl_about_duration2(tr::now) - : tr::lng_ttl_about_duration3(tr::now); + : Ui::FormatTTL(period); const auto text = peer->isBroadcast() ? tr::lng_ttl_about_tooltip_channel(tr::now, lt_duration, duration) : tr::lng_ttl_about_tooltip(tr::now, lt_duration, duration); diff --git a/Telegram/SourceFiles/settings/settings_privacy_security.cpp b/Telegram/SourceFiles/settings/settings_privacy_security.cpp index 989a76779..aa1b090e2 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_security.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_security.cpp @@ -284,14 +284,8 @@ void SetupLocalPasscode( lt_minutes_count, QString::number(minutes)) : minutes - ? tr::lng_passcode_autolock_minutes( - tr::now, - lt_count, - minutes) - : tr::lng_passcode_autolock_hours( - tr::now, - lt_count, - hours); + ? tr::lng_minutes(tr::now, lt_count, minutes) + : tr::lng_hours(tr::now, lt_count, hours); }); AddButtonWithLabel( @@ -511,13 +505,13 @@ void SetupCloudPassword( const auto hours = left / kHour; const auto minutes = left / kMinute; return 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_hours(tr::now, lt_count, hours) : minutes - ? tr::lng_group_call_duration_minutes(tr::now, lt_count, minutes) + ? tr::lng_minutes(tr::now, lt_count, minutes) : left - ? tr::lng_group_call_duration_seconds(tr::now, lt_count, left) + ? tr::lng_seconds(tr::now, lt_count, left) : QString(); }); diff --git a/Telegram/SourceFiles/ui/boxes/choose_time.cpp b/Telegram/SourceFiles/ui/boxes/choose_time.cpp index f094d9ac2..488c1c0d3 100644 --- a/Telegram/SourceFiles/ui/boxes/choose_time.cpp +++ b/Telegram/SourceFiles/ui/boxes/choose_time.cpp @@ -79,14 +79,14 @@ ChooseTimeResult ChooseTimeWidget( const auto hour = Ui::MakeWeak(state->hour); const auto minute = Ui::MakeWeak(state->minute); - day->setPhrase(tr::lng_mute_box_days); + day->setPhrase(tr::lng_days); day->setMaxValue(31); day->setWheelStep(1); day->putNext() | rpl::start_with_next([=](QChar ch) { putNext(hour, ch); }, content->lifetime()); - hour->setPhrase(tr::lng_mute_box_hours); + hour->setPhrase(tr::lng_hours); hour->setMaxValue(23); hour->setWheelStep(1); hour->putNext() | rpl::start_with_next([=](QChar ch) { @@ -96,7 +96,7 @@ ChooseTimeResult ChooseTimeWidget( erasePrevious(day); }, content->lifetime()); - minute->setPhrase(tr::lng_mute_box_minutes); + minute->setPhrase(tr::lng_minutes); minute->setMaxValue(59); minute->setWheelStep(10); minute->erasePrevious() | rpl::start_with_next([=] { diff --git a/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp b/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp index 62654996a..a27a18859 100644 --- a/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp +++ b/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp @@ -30,20 +30,11 @@ constexpr auto kMaxLabelLength = 32; if (date > 0) { return langDateTime(base::unixtime::parse(date)); } else if (-date < kDay) { - return tr::lng_group_call_duration_hours( - tr::now, - lt_count, - (-date / kHour)); + return tr::lng_hours(tr::now, lt_count, (-date / kHour)); } else if (-date < 7 * kDay) { - return tr::lng_group_call_duration_days( - tr::now, - lt_count, - (-date / kDay)); + return tr::lng_days(tr::now, lt_count, (-date / kDay)); } else { - return tr::lng_local_storage_limit_weeks( - tr::now, - lt_count, - (-date / (7 * kDay))); + return tr::lng_weeks(tr::now, lt_count, (-date / (7 * kDay))); } } diff --git a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp index 5add6eac4..02b3c2a38 100644 --- a/Telegram/SourceFiles/ui/chat/group_call_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/group_call_bar.cpp @@ -69,12 +69,9 @@ void GroupCallScheduledLeft::update() { constexpr auto kDay = 24 * 60 * 60; if (left >= kDay) { const auto days = (left / kDay); - _textNonNegative = tr::lng_group_call_duration_days( - tr::now, - lt_count, - days); + _textNonNegative = tr::lng_days(tr::now, lt_count, days); _text = late - ? tr::lng_group_call_duration_days(tr::now, lt_count, -days) + ? tr::lng_days(tr::now, lt_count, -days) : _textNonNegative.current(); } else { const auto hours = left / (60 * 60); diff --git a/Telegram/SourceFiles/ui/controls/delete_message_context_action.cpp b/Telegram/SourceFiles/ui/controls/delete_message_context_action.cpp index a2f1ebcb3..ca2ff25be 100644 --- a/Telegram/SourceFiles/ui/controls/delete_message_context_action.cpp +++ b/Telegram/SourceFiles/ui/controls/delete_message_context_action.cpp @@ -137,10 +137,7 @@ void ActionWithTimer::refreshAutoDeleteText() { const auto left = (_destroyAt > now) ? (_destroyAt - now) : 0; const auto text = [&] { const auto duration = (left >= 86400) - ? tr::lng_group_call_duration_days( - tr::now, - lt_count, - ((left + 43200) / 86400)) + ? tr::lng_days(tr::now, lt_count, ((left + 43200) / 86400)) : (left >= 3600) ? QString("%1:%2:%3" ).arg(left / 3600 @@ -191,10 +188,7 @@ void ActionWithTimer::prepare() { + padding.right(); }; const auto maxWidth1 = ttlMaxWidth("23:59:59"); - const auto maxWidth2 = ttlMaxWidth(tr::lng_group_call_duration_days( - tr::now, - lt_count, - 7)); + const auto maxWidth2 = ttlMaxWidth(tr::lng_days(tr::now, lt_count, 7)); const auto w = std::clamp( std::max({ goodWidth, maxWidth1, maxWidth2 }), diff --git a/Telegram/SourceFiles/ui/text/format_values.cpp b/Telegram/SourceFiles/ui/text/format_values.cpp index 9930cfdeb..34165400e 100644 --- a/Telegram/SourceFiles/ui/text/format_values.cpp +++ b/Telegram/SourceFiles/ui/text/format_values.cpp @@ -117,7 +117,7 @@ QString FormatDurationWords(qint64 duration) { auto secondsCount = tr::lng_duration_minsec_seconds(tr::now, lt_count, seconds); return tr::lng_duration_minutes_seconds(tr::now, lt_minutes_count, minutesCount, lt_seconds_count, secondsCount); } - return tr::lng_duration_seconds(tr::now, lt_count, duration); + return tr::lng_seconds(tr::now, lt_count, duration); } QString FormatDurationAndSizeText(qint64 duration, qint64 size) {