Improve slowmode error phrases.

This commit is contained in:
John Preston 2019-07-30 18:09:41 +02:00
parent 787b5f549a
commit 80fedcbbae
3 changed files with 6 additions and 5 deletions

View File

@ -1644,7 +1644,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_rights_user_restrictions" = "User restrictions";
"lng_rights_user_restrictions_header" = "What can this member do?";
"lng_rights_default_restrictions_header" = "What can members of this group do?";
"lng_rights_slowmode_header" = "Slowmode";
"lng_rights_slowmode_header" = "Slow mode";
"lng_rights_slowmode_off" = "Off";
"lng_rights_slowmode_seconds#one" = "{count}s";
"lng_rights_slowmode_seconds#other" = "{count}s";
@ -1659,8 +1659,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_rights_slowmode_interval_minutes#one" = "every {count} minute";
"lng_rights_slowmode_interval_minutes#other" = "every {count} minutes";
"lng_slowmode_enabled"= "Slowmode is enabled. You can send your next message in {left}.";
"lng_slowmode_no_many" = "Slowmode is enabled. You can't send more than one message at once.";
"lng_slowmode_enabled"= "Slow mode is enabled. You can send your next message in {left}.";
"lng_slowmode_no_many" = "Slow mode is enabled. You can't send more than one message at a time.";
"lng_slowmode_too_long" = "Sorry, this text is too long to send as one message.\n\nSlow mode is enabled. You can't send more than one message at a time.";
"lng_rights_channel_info" = "Change channel info";
"lng_rights_channel_post" = "Post messages";

View File

@ -141,7 +141,7 @@ QString GetErrorTextForForward(
}
}
if (comment.text.size() > MaxMessageSize) {
return tr::lng_slowmode_no_many(tr::now);
return tr::lng_slowmode_too_long(tr::now);
} else if (!items.empty() && !comment.text.isEmpty()) {
return tr::lng_slowmode_no_many(tr::now);
} else if (items.size() > 1) {

View File

@ -22,7 +22,7 @@ Widget::Widget(QWidget *parent, const Config &config) : TWidget(parent)
st::toastTextStyle.font->height * (_multiline ? config.maxLines : 1))
, _text(_multiline ? config.minWidth : QFIXED_MAX) {
const auto toastOptions = TextParseOptions{
0,
TextParseMultiline,
_maxTextWidth,
_maxTextHeight,
Qt::LayoutDirectionAuto