From 7af0dd105e2e4839d9f49e8cf0dba51f60d6bb30 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 18 Jun 2019 14:16:43 +0200 Subject: [PATCH] Use tr:: instead of Lang::Viewer. --- .../SourceFiles/boxes/auto_download_box.cpp | 20 +-- .../SourceFiles/boxes/change_phone_box.cpp | 4 +- .../SourceFiles/boxes/create_poll_box.cpp | 4 +- .../SourceFiles/boxes/edit_privacy_box.cpp | 6 +- Telegram/SourceFiles/boxes/edit_privacy_box.h | 4 +- .../boxes/peers/edit_contact_box.cpp | 2 +- .../boxes/peers/edit_linked_chat_box.cpp | 7 +- .../boxes/peers/edit_participant_box.cpp | 10 +- .../edit_peer_history_visibility_box.cpp | 18 +-- .../boxes/peers/edit_peer_info_box.cpp | 82 ++++++----- .../boxes/peers/edit_peer_permissions_box.cpp | 14 +- .../boxes/peers/edit_peer_permissions_box.h | 4 +- .../boxes/peers/edit_peer_type_box.cpp | 69 ++++----- .../boxes/peers/edit_peer_type_box.h | 4 +- Telegram/SourceFiles/boxes/sessions_box.cpp | 18 +-- .../view/export_view_panel_controller.cpp | 10 +- .../SourceFiles/history/history_widget.cpp | 5 +- Telegram/SourceFiles/info/info_top_bar.cpp | 138 +++++++++--------- .../info/profile/info_profile_actions.cpp | 76 +++++----- .../info/profile/info_profile_cover.cpp | 2 +- .../info/profile/info_profile_values.cpp | 11 +- .../info/profile/info_profile_values.h | 6 - Telegram/SourceFiles/lang/lang_instance.cpp | 11 +- Telegram/SourceFiles/lang/lang_instance.h | 9 +- Telegram/SourceFiles/lang/lang_values.h | 15 +- .../SourceFiles/passport/passport_panel.cpp | 2 +- .../passport/passport_panel_controller.cpp | 10 +- .../passport/passport_panel_edit_contact.cpp | 14 +- .../passport/passport_panel_edit_scans.cpp | 38 ++--- .../settings/settings_advanced.cpp | 24 +-- .../SourceFiles/settings/settings_calls.cpp | 14 +- .../SourceFiles/settings/settings_chat.cpp | 38 ++--- .../SourceFiles/settings/settings_common.cpp | 30 ++-- .../SourceFiles/settings/settings_common.h | 15 +- .../settings/settings_information.cpp | 16 +- .../SourceFiles/settings/settings_intro.cpp | 2 +- .../SourceFiles/settings/settings_main.cpp | 22 +-- .../settings/settings_notifications.cpp | 12 +- .../settings/settings_privacy_controllers.cpp | 96 ++++++------ .../settings/settings_privacy_controllers.h | 39 +++-- .../settings/settings_privacy_security.cpp | 69 +++++---- .../settings/settings_privacy_security.h | 2 +- .../window/window_outdated_bar.cpp | 2 +- 43 files changed, 483 insertions(+), 511 deletions(-) diff --git a/Telegram/SourceFiles/boxes/auto_download_box.cpp b/Telegram/SourceFiles/boxes/auto_download_box.cpp index d042b9679..f9b70c0f3 100644 --- a/Telegram/SourceFiles/boxes/auto_download_box.cpp +++ b/Telegram/SourceFiles/boxes/auto_download_box.cpp @@ -63,14 +63,14 @@ void AutoDownloadBox::setupContent() { }; const auto values = Ui::CreateChild>(content); - const auto add = [&](Type type, LangKey label) { + const auto add = [&](Type type, rpl::producer label) { if (ranges::find(kHidden, type) != end(kHidden)) { return; } const auto value = settings->bytesLimit(_source, type); AddButton( content, - label, + std::move(label), st::settingsButton )->toggleOn( rpl::single(value > 0) @@ -80,13 +80,13 @@ void AutoDownloadBox::setupContent() { }, content->lifetime()); values->emplace(type, value); }; - add(Type::Photo, lng_media_photo_title); - add(Type::VoiceMessage, lng_media_audio_title); - add(Type::VideoMessage, lng_media_video_messages_title); - add(Type::Video, lng_media_video_title); - add(Type::File, lng_media_file_title); - add(Type::Music, lng_media_music_title); - add(Type::GIF, lng_media_animation_title); + add(Type::Photo, tr::lng_media_photo_title()); + add(Type::VoiceMessage, tr::lng_media_audio_title()); + add(Type::VideoMessage, tr::lng_media_video_messages_title()); + add(Type::Video, tr::lng_media_video_title()); + add(Type::File, tr::lng_media_file_title()); + add(Type::Music, tr::lng_media_music_title()); + add(Type::GIF, tr::lng_media_animation_title()); const auto limits = Ui::CreateChild>(content); using Pair = base::flat_map::value_type; @@ -98,7 +98,7 @@ void AutoDownloadBox::setupContent() { const auto limit = Ui::CreateChild(content, initialLimit); AddButtonWithLabel( content, - lng_media_size_limit, + tr::lng_media_size_limit(), limits->events_starting_with_copy( initialLimit ) | rpl::map([](int value) { diff --git a/Telegram/SourceFiles/boxes/change_phone_box.cpp b/Telegram/SourceFiles/boxes/change_phone_box.cpp index 6b31780e4..edf34d2d5 100644 --- a/Telegram/SourceFiles/boxes/change_phone_box.cpp +++ b/Telegram/SourceFiles/boxes/change_phone_box.cpp @@ -350,9 +350,7 @@ void ChangePhoneBox::prepare() { const auto label = Ui::CreateChild( this, - Lang::Viewer( - lng_change_phone_about - ) | Ui::Text::ToRichLangValue(), + tr::lng_change_phone_about(Ui::Text::RichLangValue), st::changePhoneDescription); label->moveToLeft((st::boxWideWidth - label->width()) / 2, st::changePhoneDescriptionTop); diff --git a/Telegram/SourceFiles/boxes/create_poll_box.cpp b/Telegram/SourceFiles/boxes/create_poll_box.cpp index 74c4b4941..6045602a6 100644 --- a/Telegram/SourceFiles/boxes/create_poll_box.cpp +++ b/Telegram/SourceFiles/boxes/create_poll_box.cpp @@ -597,7 +597,7 @@ not_null CreatePollBox::setupQuestion( not_null container) { using namespace Settings; - AddSubsectionTitle(container, lng_polls_create_question); + AddSubsectionTitle(container, tr::lng_polls_create_question()); const auto question = container->add( object_ptr( container, @@ -645,7 +645,7 @@ object_ptr CreatePollBox::setupContent() { const auto question = setupQuestion(container); AddDivider(container); AddSkip(container); - AddSubsectionTitle(container, lng_polls_create_options); + AddSubsectionTitle(container, tr::lng_polls_create_options()); const auto options = lifetime().make_state( getDelegate()->outerContainer(), container); diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 98fda2c80..8af1f0f4c 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -311,13 +311,13 @@ void EditPrivacyBox::setupContent() { content, object_ptr