diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index 9341e8f21..f50c83473 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -131,6 +131,14 @@ "ktg_settings_chat_id_telegram": "Telegram API", "ktg_settings_chat_id_bot": "Bot API", "ktg_message_id": "Message ID: {id}", + "ktg_local_storage_limit_days": { + "zero": "{count} days", + "one": "{count} day", + "two": "{count} days", + "few": "{count} days", + "many": "{count} days", + "other": "{count} days" + }, "ktg_settings_monospace_large_bubbles": "Expand bubbles with monospace", "ktg_bot_id_copied": "Bot ID copied to clipboard.", "ktg_user_id_copied": "User ID copied to clipboard.", diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index b70e9c3b6..3b67d0487 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "boxes/local_storage_box.h" +#include "kotato/kotato_lang.h" #include "ui/wrap/vertical_layout.h" #include "ui/wrap/slide_wrap.h" #include "ui/widgets/labels.h" @@ -31,7 +32,7 @@ constexpr auto kMegabyte = int64(1024 * 1024); constexpr auto kTotalSizeLimitsCount = 18; constexpr auto kMediaSizeLimitsCount = 18; constexpr auto kMinimalSizeLimit = 100 * kMegabyte; -constexpr auto kTimeLimitsCount = 16; +constexpr auto kTimeLimitsCount = 22; constexpr auto kMaxTimeLimitValue = std::numeric_limits::max(); constexpr auto kFakeMediaCacheTag = uint16(0xFFFF); @@ -92,8 +93,16 @@ size_type TimeLimitInDays(int index) { return 0; } +size_type TimeLimitInDaysKotato(int index) { + if (index < 6) { + const auto days = (index + 1); + return size_type(days); + } + return TimeLimitInDays(index - 6); +} + size_type TimeLimit(int index) { - const auto days = TimeLimitInDays(index); + const auto days = TimeLimitInDaysKotato(index); return days ? (days * 24 * 60 * 60) : kMaxTimeLimitValue; @@ -105,8 +114,10 @@ QString TimeLimitText(size_type limit) { const auto months = (days / 29); return (months > 0) ? tr::lng_local_storage_limit_months(tr::now, lt_count, months) - : (limit > 0) + : (weeks > 0) ? tr::lng_local_storage_limit_weeks(tr::now, lt_count, weeks) + : (limit > 0) + ? ktr("ktg_local_storage_limit_days", days, { "count", QString::number(days) }) : tr::lng_local_storage_limit_never(tr::now); }