From dde4868540f3314ade65c6862765ab9e3e1b4d68 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 27 Feb 2022 16:32:36 +0300 Subject: [PATCH] Add phrases to lang.string. --- Telegram/Resources/langs/lang.strings | 11 +++++ .../data/data_download_manager.cpp | 15 +++--- .../SourceFiles/data/data_download_manager.h | 6 +-- .../data/data_file_click_handler.cpp | 15 ++++-- .../data/data_file_click_handler.h | 4 ++ .../history/history_inner_widget.cpp | 2 +- .../view/history_view_context_menu.cpp | 5 +- .../downloads/info_downloads_provider.cpp | 47 ++++++++++++++----- .../info/downloads/info_downloads_provider.h | 7 ++- Telegram/SourceFiles/info/info_top_bar.cpp | 2 +- .../SourceFiles/info/info_wrap_widget.cpp | 6 ++- .../info/media/info_media_common.h | 4 +- .../info/media/info_media_list_widget.cpp | 18 ++++--- .../info/media/info_media_provider.cpp | 7 ++- .../info/media/info_media_provider.h | 4 +- .../media/player/media_player_instance.cpp | 8 ++-- .../media/view/media_view_overlay_widget.cpp | 22 +++++++-- .../SourceFiles/overview/overview_layout.cpp | 2 +- .../SourceFiles/settings/settings_chat.cpp | 2 +- .../SourceFiles/settings/settings_main.cpp | 2 +- .../settings/settings_privacy_security.cpp | 2 +- .../SourceFiles/ui/controls/download_bar.cpp | 6 +-- 22 files changed, 135 insertions(+), 62 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index e592dc9354..a2fe885067 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -475,6 +475,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_settings_theme_accent_title" = "Choose accent color"; "lng_settings_data_storage" = "Data and storage"; "lng_settings_information" = "Edit profile"; +"lng_settings_security" = "Security"; "lng_settings_passcode_title" = "Local passcode"; "lng_settings_password_title" = "Two-step verification"; "lng_settings_sessions_title" = "Active sessions"; @@ -732,6 +733,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_settings_faq_button" = "Go to FAQ"; "lng_settings_ask_ok" = "Ask a Volunteer"; "lng_settings_faq" = "Telegram FAQ"; +"lng_settings_features" = "Telegram Features"; "lng_settings_logout" = "Log Out"; "lng_sure_logout" = "Are you sure you want to log out?"; @@ -1831,6 +1833,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_context_seen_reacted_none" = "Nobody Reacted"; "lng_context_seen_reacted_all" = "Show All Reactions"; "lng_context_set_as_quick" = "Set As Quick"; +"lng_context_delete_from_disk" = "Delete from disk"; +"lng_context_delete_all_files" = "Delete all files"; + +"lng_downloads_section" = "Downloads"; +"lng_downloads_view_in_chat" = "View in chat"; +"lng_downloads_view_in_section" = "View in downloads"; +"lng_downloads_delete_sure_one" = "Do you want to delete this file?"; +"lng_downloads_delete_sure#one" = "Do you want to delete {count} file?"; +"lng_downloads_delete_sure#other" = "Do you want to delete {count} files?"; "lng_send_image_empty" = "Could not send an empty file: {name}"; "lng_send_image_too_large" = "Could not send a file, because it is larger than 1500 MB: {name}"; diff --git a/Telegram/SourceFiles/data/data_download_manager.cpp b/Telegram/SourceFiles/data/data_download_manager.cpp index b694ed87b6..8dc5262cd1 100644 --- a/Telegram/SourceFiles/data/data_download_manager.cpp +++ b/Telegram/SourceFiles/data/data_download_manager.cpp @@ -98,7 +98,7 @@ void DownloadManager::trackSession(not_null session) { }, data.lifetime); } -int64 DownloadManager::computeNextStarted() { +int64 DownloadManager::computeNextStartDate() { const auto now = base::unixtime::now(); if (_lastStartedBase != now) { _lastStartedBase = now; @@ -111,7 +111,7 @@ int64 DownloadManager::computeNextStarted() { void DownloadManager::addLoading(DownloadObject object) { Expects(object.item != nullptr); - Expects(object.document || object.photo); + Expects(object.document != nullptr); const auto item = object.item; auto &data = sessionData(item); @@ -127,13 +127,16 @@ void DownloadManager::addLoading(DownloadObject object) { remove(data, already); } - const auto size = object.document - ? object.document->size - : object.photo->imageByteSize(PhotoSize::Large); + const auto size = object.document->size; + const auto path = object.document->loadingFilePath(); + if (path.isEmpty()) { + return; + } data.downloading.push_back({ .object = object, - .started = computeNextStarted(), + .started = computeNextStartDate(), + .path = path, .total = size, }); _loading.emplace(item); diff --git a/Telegram/SourceFiles/data/data_download_manager.h b/Telegram/SourceFiles/data/data_download_manager.h index 76c1b2bd9e..3057a1b65b 100644 --- a/Telegram/SourceFiles/data/data_download_manager.h +++ b/Telegram/SourceFiles/data/data_download_manager.h @@ -63,12 +63,12 @@ struct DownloadedId { uint64 peerAccessHash = 0; std::unique_ptr object; - }; struct DownloadingId { DownloadObject object; DownloadDate started = 0; + QString path; int ready = 0; int total = 0; bool done = false; @@ -81,6 +81,8 @@ public: void trackSession(not_null session); + [[nodiscard]] DownloadDate computeNextStartDate(); + void addLoading(DownloadObject object); void addLoaded( DownloadObject object, @@ -127,8 +129,6 @@ private: std::vector::iterator i); void clearLoading(); - [[nodiscard]] int64 computeNextStarted(); - [[nodiscard]] SessionData &sessionData(not_null session); [[nodiscard]] const SessionData &sessionData( not_null session) const; diff --git a/Telegram/SourceFiles/data/data_file_click_handler.cpp b/Telegram/SourceFiles/data/data_file_click_handler.cpp index d7e1b5be82..87bf283929 100644 --- a/Telegram/SourceFiles/data/data_file_click_handler.cpp +++ b/Telegram/SourceFiles/data/data_file_click_handler.cpp @@ -100,11 +100,12 @@ void DocumentSaveClickHandler::Save( data->save(origin, savename); } -void DocumentSaveClickHandler::onClickImpl() const { - const auto document = this->document(); - const auto itemId = context(); - Save(itemId, document); - if (document->loading()) { +void DocumentSaveClickHandler::SaveAndTrack( + FullMsgId itemId, + not_null document, + Mode mode) { + Save(itemId ? itemId : Data::FileOrigin(), document, mode); + if (document->loading() && !document->loadingFilePath().isEmpty()) { if (const auto item = document->owner().message(itemId)) { Core::App().downloadManager().addLoading({ .item = item, @@ -114,6 +115,10 @@ void DocumentSaveClickHandler::onClickImpl() const { } } +void DocumentSaveClickHandler::onClickImpl() const { + SaveAndTrack(context(), document()); +} + DocumentCancelClickHandler::DocumentCancelClickHandler( not_null document, Fn &&callback, diff --git a/Telegram/SourceFiles/data/data_file_click_handler.h b/Telegram/SourceFiles/data/data_file_click_handler.h index 995307d1ab..459ebddfea 100644 --- a/Telegram/SourceFiles/data/data_file_click_handler.h +++ b/Telegram/SourceFiles/data/data_file_click_handler.h @@ -52,6 +52,10 @@ public: Data::FileOrigin origin, not_null document, Mode mode = Mode::ToCacheOrFile); + static void SaveAndTrack( + FullMsgId itemId, + not_null document, + Mode mode = Mode::ToCacheOrFile); protected: void onClickImpl() const override; diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 75f9c38347..38ac13d0f5 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2422,7 +2422,7 @@ void HistoryInner::showContextInFolder(not_null document) { void HistoryInner::saveDocumentToFile( FullMsgId contextId, not_null document) { - DocumentSaveClickHandler::Save( + DocumentSaveClickHandler::SaveAndTrack( contextId, document, DocumentSaveClickHandler::Mode::ToNewFile); diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index f4c8f2bd92..6c2a6a9c1d 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -205,10 +205,9 @@ void AddSaveDocumentAction( if (list->hasCopyRestriction(item)) { return; } - const auto origin = Data::FileOrigin( - item ? item->fullId() : FullMsgId()); + const auto origin = item ? item->fullId() : FullMsgId(); const auto save = [=] { - DocumentSaveClickHandler::Save( + DocumentSaveClickHandler::SaveAndTrack( origin, document, DocumentSaveClickHandler::Mode::ToNewFile); diff --git a/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp b/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp index 38d6c8bc7a..78b81c00fe 100644 --- a/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp +++ b/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp @@ -100,7 +100,11 @@ void Provider::refreshViewer() { const auto item = id->object.item; if (!copy.remove(item) && !_downloaded.contains(item)) { _downloading.emplace(item); - _elements.push_back(Element{ item, id->started }); + _elements.push_back({ + .item = item, + .started = id->started, + .path = id->path, + }); trackItemSession(item); refreshPostponed(true); } @@ -130,7 +134,9 @@ void Provider::refreshViewer() { remove(item); } else { _downloaded.remove(item); - _addPostponed.remove(item); + _addPostponed.erase( + ranges::remove(_addPostponed, item, &Element::item), + end(_addPostponed)); } }, _lifetime); @@ -143,11 +149,21 @@ void Provider::addPostponed(not_null entry) { const auto item = entry->object->item; trackItemSession(item); - if (_addPostponed.emplace(item, entry->started).second - && _addPostponed.size() == 1) { - Ui::PostponeCall(this, [=] { - performAdd(); + const auto i = ranges::find(_addPostponed, item, &Element::item); + if (i != end(_addPostponed)) { + i->path = entry->path; + i->started = entry->started; + } else { + _addPostponed.push_back({ + .item = item, + .started = entry->started, + .path = entry->path, }); + if (_addPostponed.size() == 1) { + Ui::PostponeCall(this, [=] { + performAdd(); + }); + } } } @@ -155,17 +171,19 @@ void Provider::performAdd() { if (_addPostponed.empty()) { return; } - for (const auto &[item, started] : base::take(_addPostponed)) { - _downloaded.emplace(item); - if (!_downloading.remove(item)) { - _elements.push_back(Element{ item, started }); + for (auto &element : base::take(_addPostponed)) { + _downloaded.emplace(element.item); + if (!_downloading.remove(element.item)) { + _elements.push_back(std::move(element)); } } refreshPostponed(true); } void Provider::remove(not_null item) { - _addPostponed.remove(item); + _addPostponed.erase( + ranges::remove(_addPostponed, item, &Element::item), + end(_addPostponed)); _downloading.remove(item); _downloaded.remove(item); _elements.erase( @@ -361,8 +379,11 @@ bool Provider::allowSaveFileAs( return false; } -std::optional Provider::deleteMenuPhrase() { - return u"Delete from disk"_q; +QString Provider::showInFolderPath( + not_null item, + not_null document) { + const auto i = ranges::find(_elements, item, &Element::item); + return (i != end(_elements)) ? i->path : QString(); } void Provider::saveState( diff --git a/Telegram/SourceFiles/info/downloads/info_downloads_provider.h b/Telegram/SourceFiles/info/downloads/info_downloads_provider.h index 919ebfe712..f4296bdda5 100644 --- a/Telegram/SourceFiles/info/downloads/info_downloads_provider.h +++ b/Telegram/SourceFiles/info/downloads/info_downloads_provider.h @@ -66,7 +66,9 @@ public: bool allowSaveFileAs( not_null item, not_null document) override; - std::optional deleteMenuPhrase() override; + QString showInFolderPath( + not_null item, + not_null document) override; void saveState( not_null memento, @@ -79,6 +81,7 @@ private: struct Element { not_null item; int64 started = 0; // unixtime * 1000 + QString path; }; bool sectionHasFloatingHeader() override; @@ -112,7 +115,7 @@ private: base::flat_set> _downloading; base::flat_set> _downloaded; - base::flat_map, int64> _addPostponed; + std::vector _addPostponed; std::unordered_map< not_null, diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index f87e12c41d..daf21dcc69 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -647,7 +647,7 @@ rpl::producer TitleValue( : tr::lng_polls_poll_results_title(); case Section::Type::Downloads: - return rpl::single(u"Downloads"_q); + return tr::lng_downloads_section(); } Unexpected("Bad section type in Info::TitleValue()"); diff --git a/Telegram/SourceFiles/info/info_wrap_widget.cpp b/Telegram/SourceFiles/info/info_wrap_widget.cpp index 28aebfa9cb..1aded0a0e3 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.cpp +++ b/Telegram/SourceFiles/info/info_wrap_widget.cpp @@ -200,8 +200,10 @@ Key WrapWidget::key() const { Dialogs::RowDescriptor WrapWidget::activeChat() const { if (const auto peer = key().peer()) { - return Dialogs::RowDescriptor(peer->owner().history(peer), FullMsgId()); - } else if (key().settingsSelf() || key().poll()) { + return Dialogs::RowDescriptor( + peer->owner().history(peer), + FullMsgId()); + } else if (key().settingsSelf() || key().isDownloads() || key().poll()) { return Dialogs::RowDescriptor(); } Unexpected("Owner in WrapWidget::activeChat()."); diff --git a/Telegram/SourceFiles/info/media/info_media_common.h b/Telegram/SourceFiles/info/media/info_media_common.h index 689abc20bf..2418c1b49e 100644 --- a/Telegram/SourceFiles/info/media/info_media_common.h +++ b/Telegram/SourceFiles/info/media/info_media_common.h @@ -153,7 +153,9 @@ public: [[nodiscard]] virtual bool allowSaveFileAs( not_null item, not_null document) = 0; - [[nodiscard]] virtual std::optional deleteMenuPhrase() = 0; + [[nodiscard]] virtual QString showInFolderPath( + not_null item, + not_null document) = 0; virtual void saveState( not_null memento, diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index 488c457970..b304373ab7 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -873,7 +873,9 @@ void ListWidget::showContextMenu( }, &st::menuIconCancel); } else { - auto filepath = lnkDocument->filepath(true); + const auto filepath = _provider->showInFolderPath( + item, + lnkDocument); if (!filepath.isEmpty()) { auto handler = App::LambdaDelayed( st::defaultDropdownMenu.menu.ripple.hideDuration, @@ -892,7 +894,7 @@ void ListWidget::showContextMenu( st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] { - DocumentSaveClickHandler::Save( + DocumentSaveClickHandler::SaveAndTrack( globalId.itemId, lnkDocument, DocumentSaveClickHandler::Mode::ToNewFile); @@ -934,7 +936,7 @@ void ListWidget::showContextMenu( if (canDeleteAll()) { _contextMenu->addAction( (_controller->isDownloads() - ? u"Delete from disk"_q + ? tr::lng_context_delete_from_disk(tr::now) : tr::lng_context_delete_selected(tr::now)), crl::guard(this, [this] { deleteSelected(); @@ -961,7 +963,7 @@ void ListWidget::showContextMenu( if (selectionData.canDelete) { if (_controller->isDownloads()) { _contextMenu->addAction( - u"Delete from disk"_q, + tr::lng_context_delete_from_disk(tr::now), crl::guard(this, [=] { deleteItem(globalId); }), &st::menuIconDelete); } else { @@ -1062,9 +1064,10 @@ void ListWidget::deleteItems(SelectedItems &&items, Fn confirmed) { if (items.list.empty()) { return; } else if (_controller->isDownloads()) { - const auto phrase = (items.list.size() == 1) - ? u"Do you want to delete this file?"_q - : u"Do you want to delete X files?"_q; + const auto count = items.list.size(); + const auto phrase = (count == 1) + ? tr::lng_downloads_delete_sure_one(tr::now) + : tr::lng_downloads_delete_sure(tr::now, lt_count, count); const auto deleteSure = [=] { const auto ids = ranges::views::all( items.list @@ -1072,6 +1075,7 @@ void ListWidget::deleteItems(SelectedItems &&items, Fn confirmed) { return item.globalId; }) | ranges::to_vector; Core::App().downloadManager().deleteFiles(ids); + confirmed(); if (const auto box = _actionBoxWeak.data()) { box->closeBox(); } diff --git a/Telegram/SourceFiles/info/media/info_media_provider.cpp b/Telegram/SourceFiles/info/media/info_media_provider.cpp index 63945d9652..ab567a9ed1 100644 --- a/Telegram/SourceFiles/info/media/info_media_provider.cpp +++ b/Telegram/SourceFiles/info/media/info_media_provider.cpp @@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_channel.h" #include "data/data_user.h" #include "data/data_peer_values.h" +#include "data/data_document.h" #include "styles/style_info.h" namespace Info::Media { @@ -476,8 +477,10 @@ bool Provider::allowSaveFileAs( return item->allowsForward(); } -std::optional Provider::deleteMenuPhrase() { - return std::nullopt; +QString Provider::showInFolderPath( + not_null item, + not_null document) { + return document->filepath(true); } void Provider::applyDragSelection( diff --git a/Telegram/SourceFiles/info/media/info_media_provider.h b/Telegram/SourceFiles/info/media/info_media_provider.h index 8af8fd4317..3320d09fcd 100644 --- a/Telegram/SourceFiles/info/media/info_media_provider.h +++ b/Telegram/SourceFiles/info/media/info_media_provider.h @@ -59,7 +59,9 @@ public: bool allowSaveFileAs( not_null item, not_null document) override; - std::optional deleteMenuPhrase() override; + QString showInFolderPath( + not_null item, + not_null document) override; void saveState( not_null memento, diff --git a/Telegram/SourceFiles/media/player/media_player_instance.cpp b/Telegram/SourceFiles/media/player/media_player_instance.cpp index 2f458262a6..7112298d11 100644 --- a/Telegram/SourceFiles/media/player/media_player_instance.cpp +++ b/Telegram/SourceFiles/media/player/media_player_instance.cpp @@ -1320,12 +1320,12 @@ void Instance::handleStreamingError( const auto document = data->streamed->id.audio(); const auto contextId = data->streamed->id.contextId(); if (error == Streaming::Error::NotStreamable) { - DocumentSaveClickHandler::Save( - (contextId ? contextId : ::Data::FileOrigin()), + DocumentSaveClickHandler::SaveAndTrack( + contextId, document); } else if (error == Streaming::Error::OpenFailed) { - DocumentSaveClickHandler::Save( - (contextId ? contextId : ::Data::FileOrigin()), + DocumentSaveClickHandler::SaveAndTrack( + contextId, document, DocumentSaveClickHandler::Mode::ToFile); } diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 21cdaabf47..d9c1ca17a8 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -55,6 +55,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_document_media.h" #include "data/data_document_resolver.h" #include "data/data_file_click_handler.h" +#include "data/data_download_manager.h" #include "window/themes/window_theme_preview.h" #include "window/window_peer_menu.h" #include "window/window_session_controller.h" @@ -1561,14 +1562,21 @@ void OverlayWidget::saveAs() { f.open(QIODevice::WriteOnly); f.write(bytes); } + if (_message) { + auto &manager = Core::App().downloadManager(); + manager.addLoaded({ + .item = _message, + .document = _document, + }, file, manager.computeNextStartDate()); + } } if (bytes.isEmpty()) { location.accessDisable(); } } else { - DocumentSaveClickHandler::Save( - fileOrigin(), + DocumentSaveClickHandler::SaveAndTrack( + _message ? _message->fullId() : FullMsgId(), _document, DocumentSaveClickHandler::Mode::ToNewFile); updateControls(); @@ -1671,14 +1679,20 @@ void OverlayWidget::downloadMedia() { QFile(toName).remove(); if (!QFile(location.name()).copy(toName)) { toName = QString(); + } else if (_message) { + auto &manager = Core::App().downloadManager(); + manager.addLoaded({ + .item = _message, + .document = _document, + }, toName, manager.computeNextStartDate()); } } location.accessDisable(); } else { if (_document->filepath(true).isEmpty() && !_document->loading()) { - DocumentSaveClickHandler::Save( - fileOrigin(), + DocumentSaveClickHandler::SaveAndTrack( + _message ? _message->fullId() : FullMsgId(), _document, DocumentSaveClickHandler::Mode::ToFile); updateControls(); diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 7b16462b8d..37bb1dd98a 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -942,7 +942,7 @@ Document::Document( _name.setMarkedText( st::defaultTextStyle, (_forceFileLayout - ? TextWithEntities{ _data->filename() } + ? Ui::Text::Bold(_data->filename()) : Ui::Text::FormatSongNameFor(_data).textWithEntities()), _documentNameOptions); diff --git a/Telegram/SourceFiles/settings/settings_chat.cpp b/Telegram/SourceFiles/settings/settings_chat.cpp index ff757a1f51..20afe6ace7 100644 --- a/Telegram/SourceFiles/settings/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/settings_chat.cpp @@ -898,7 +898,7 @@ void SetupDataStorage( AddButton( container, - rpl::single(u"Downloads"_q), + tr::lng_downloads_section(), st::settingsButton, { &st::settingsIconDownload, kIconPurple } )->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/settings/settings_main.cpp b/Telegram/SourceFiles/settings/settings_main.cpp index 7c6b03da01..e01dccc3a6 100644 --- a/Telegram/SourceFiles/settings/settings_main.cpp +++ b/Telegram/SourceFiles/settings/settings_main.cpp @@ -468,7 +468,7 @@ void SetupHelp( AddButton( container, - rpl::single(u"Telegram Features"_q), + tr::lng_settings_features(), st::settingsButton, { &st::settingsIconTips, kIconLightOrange } )->setClickedCallback([=] { diff --git a/Telegram/SourceFiles/settings/settings_privacy_security.cpp b/Telegram/SourceFiles/settings/settings_privacy_security.cpp index d8212f8166..4404cc097e 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_security.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_security.cpp @@ -832,7 +832,7 @@ void SetupSecurity( rpl::producer<> updateTrigger, Fn showOther) { AddSkip(container, st::settingsPrivacySkip); - AddSubsectionTitle(container, rpl::single(u"Security"_q)); + AddSubsectionTitle(container, tr::lng_settings_security()); SetupBlockedList( controller, diff --git a/Telegram/SourceFiles/ui/controls/download_bar.cpp b/Telegram/SourceFiles/ui/controls/download_bar.cpp index e9cfcb0806..489e647972 100644 --- a/Telegram/SourceFiles/ui/controls/download_bar.cpp +++ b/Telegram/SourceFiles/ui/controls/download_bar.cpp @@ -68,9 +68,9 @@ void DownloadBar::refreshInfo(const DownloadBarProgress &progress) { (progress.ready < progress.total ? Text::WithEntities( FormatDownloadText(progress.ready, progress.total)) - : (_content.count > 1) - ? Text::Link(u"View downloads"_q) - : Text::Link(u"View in chat"_q))); + : Text::Link((_content.count > 1) + ? tr::lng_downloads_view_in_section(tr::now) + : tr::lng_downloads_view_in_chat(tr::now)))); _button.entity()->update(); }