diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 58bfee811..20d5f72ba 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2515,6 +2515,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_settings_disable_tray_counter" = "Disable tray icon counter"; "ktg_settings_use_telegram_panel_icon" = "Ask the system for telegram icon"; +"ktg_local_storage_limit_days#one" = "{count} day"; +"ktg_local_storage_limit_days#other" = "{count} days"; + "ktg_settings_chat_id" = "Chat ID in profile"; "ktg_settings_chat_id_desc" = "You can choose desired format here.\n\nTelegram API uses IDs as-is, but Bot API adds minus in the beginning for groups, and -100 for channels and supergroups to fit it in one field.\n\nIf you have profile panel opened, re-open it to see changes."; "ktg_settings_chat_id_disable" = "Hide"; diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index 0a202c70e..c9a8be40e 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -125,5 +125,11 @@ "ktg_settings_chat_id_telegram": "Telegram API", "ktg_settings_chat_id_bot": "Bot API", "ktg_message_id": "ID сообщения: {id}", - "ktg_emoji_panel_hover": "Панель эмодзи по наведению" + "ktg_emoji_panel_hover": "Панель эмодзи по наведению", + "ktg_local_storage_limit_days": { + "one": "{count} дня", + "few": "{count} дней", + "many": "{count} дней", + "other": "{count} дней" + } } diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index b850b4005..b68222e4e 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -31,7 +31,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 +92,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 +113,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) + ? tr::ktg_local_storage_limit_days(tr::now, lt_count, days) : tr::lng_local_storage_limit_never(tr::now); }