Improve phrases. No Restricted Users in channels info.

This commit is contained in:
John Preston 2017-12-27 22:44:04 +03:00
parent f2d11e7432
commit e07a7a4b4c
3 changed files with 23 additions and 21 deletions

View File

@ -137,8 +137,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_error_cant_add_admin_unban" = "Sorry, you can't add this user as an admin because they are in the blacklist and you can't unban them.";
"lng_error_cant_ban_admin" = "Sorry, you can't ban this user because they are an admin in this group and you are not allowed to demote them.";
"lng_sure_add_admin_invite" = "This user is not a member of this group. Add them to the group and promote them to admin?";
"lng_sure_add_admin_unban" = "This user is currently restricted or banned in this group. Are you sure you want to unban and promote them?";
"lng_sure_ban_admin" = "This user is an admin in this group. Are you sure you want to go ahead and restrict them?";
"lng_sure_add_admin_invite_channel" = "This user is not a subscriber of this channel. Add them to the channel and promote them to admin?";
"lng_sure_add_admin_unban" = "This user is currently restricted or banned. Are you sure you want to unban and promote them?";
"lng_sure_ban_admin" = "This user is an admin. Are you sure you want to go ahead and restrict them?";
"lng_sure_ban_user_group" = "Ban {user} in the group?";
"lng_sure_enable_socks" = "Are you sure you want to enable this proxy?\n\nServer: {server}\nPort: {port}\n\nYou can change your proxy server later in the Settings (Connection Type).";
"lng_sure_enable" = "Enable";
@ -577,8 +578,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_profile_kick" = "Remove";
"lng_profile_sure_kick" = "Remove {user} from the group?";
"lng_profile_sure_kick_channel" = "Remove {user} from the channel?";
"lng_profile_sure_remove_admin" = "Remove {user} from group admins?";
"lng_profile_sure_remove_admin_channel" = "Remove {user} from channel admins?";
"lng_profile_sure_remove_admin" = "Remove {user} from admins?";
"lng_profile_loading" = "Loading...";
"lng_profile_photos#one" = "{count} photo";
"lng_profile_photos#other" = "{count} photos";

View File

@ -168,18 +168,20 @@ void FillManageBox(
st::infoIconAdministrators);
}
if (channel->canViewBanned()) {
AddButtonWithCount(
content,
Lang::Viewer(lng_manage_peer_restricted_users),
Info::Profile::RestrictedCountValue(channel)
| ToPositiveNumberString(),
[=] {
ParticipantsBoxController::Start(
controller,
channel,
ParticipantsBoxController::Role::Restricted);
},
st::infoIconRestrictedUsers);
if (channel->isMegagroup()) {
AddButtonWithCount(
content,
Lang::Viewer(lng_manage_peer_restricted_users),
Info::Profile::RestrictedCountValue(channel)
| ToPositiveNumberString(),
[=] {
ParticipantsBoxController::Start(
controller,
channel,
ParticipantsBoxController::Role::Restricted);
},
st::infoIconRestrictedUsers);
}
AddButtonWithCount(
content,
Lang::Viewer(lng_manage_peer_banned_users),

View File

@ -872,10 +872,7 @@ void ParticipantsBoxController::kickMemberSure(not_null<UserData*> user) {
}
void ParticipantsBoxController::removeAdmin(not_null<UserData*> user) {
const auto phrase = _channel->isMegagroup()
? lng_profile_sure_remove_admin
: lng_profile_sure_remove_admin_channel;
const auto text = phrase(lt_user, user->firstName);
const auto text = lng_profile_sure_remove_admin(lt_user, user->firstName);
const auto weak = base::make_weak(this);
_editBox = Ui::show(Box<ConfirmBox>(text, lang(lng_box_remove), [=] {
if (const auto strong = weak.get()) {
@ -1379,7 +1376,10 @@ void AddParticipantBoxController::showAdmin(not_null<UserData*> user, bool sure)
// The user is not in the group yet.
if (_channel->canAddMembers()) {
if (!sure) {
_editBox = Ui::show(Box<ConfirmBox>(lang(lng_sure_add_admin_invite), [weak, user] {
const auto text = lang(_channel->isMegagroup()
? lng_sure_add_admin_invite
: lng_sure_add_admin_invite_channel);
_editBox = Ui::show(Box<ConfirmBox>(text, [weak, user] {
if (weak) {
weak->showAdmin(user, true);
}