Separate some lang keys.

Fixes #5146.
This commit is contained in:
John Preston 2018-11-12 13:20:44 +04:00
parent aba6cc2c64
commit 8b64c96381
3 changed files with 10 additions and 4 deletions

View File

@ -145,6 +145,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"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_ban_user_channel" = "Ban {user} in the channel?";
"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";
@ -606,6 +607,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_mute_duration_hours#one" = "For {count} hour";
"lng_mute_duration_hours#other" = "For {count} hours";
"lng_mute_duration_days#one" = "For {count} day";
"lng_mute_duration_days#other" = "For {count} days";
"lng_mute_duration_forever" = "Forever";
"lng_mute_box_tip" = "Choose for how long you would like to turn off notifications for the following chat";
"lng_preview_loading" = "Getting Link Info...";

View File

@ -58,9 +58,9 @@ void MuteSettingsBox::prepare() {
if (hours < 24) {
return lng_mute_duration_hours(lt_count, hours);
} else if (hours < kForeverHours) {
return lng_rights_chat_banned_day(lt_count, hours / 24);
return lng_mute_duration_days(lt_count, hours / 24);
} else {
return lang(lng_rights_chat_banned_forever);
return lang(lng_mute_duration_forever);
}
}();
object_ptr<Ui::Radiobutton> option(this, group, hours, text);

View File

@ -1592,8 +1592,10 @@ void AddParticipantBoxController::kickUser(not_null<UserData*> user, bool sure)
// Finally kick him.
if (!sure) {
auto text = lng_sure_ban_user_group(lt_user, App::peerName(user));
_editBox = Ui::show(Box<ConfirmBox>(text, [weak, user] {
const auto text = (_channel->isMegagroup()
? lng_sure_ban_user_group
: lng_sure_ban_user_channel)(lt_user, App::peerName(user));
_editBox = Ui::show(Box<ConfirmBox>(text, [=] {
if (weak) {
weak->kickUser(user, true);
}