2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Use tr:: instead of lang().

This commit is contained in:
John Preston
2019-06-19 17:09:03 +02:00
parent d3ca6b96a1
commit 87fc066e67
168 changed files with 1905 additions and 1744 deletions

View File

@@ -462,11 +462,11 @@ void ApiWrap::importChatInvite(const QString &hash) {
}).fail([=](const RPCError &error) {
const auto &type = error.type();
if (type == qstr("CHANNELS_TOO_MUCH")) {
Ui::show(Box<InformBox>(lang(lng_join_channel_error)));
Ui::show(Box<InformBox>(tr::lng_join_channel_error(tr::now)));
} else if (error.code() == 400) {
Ui::show(Box<InformBox>(lang(type == qstr("USERS_TOO_MUCH")
? lng_group_invite_no_room
: lng_group_invite_bad_link)));
Ui::show(Box<InformBox>((type == qstr("USERS_TOO_MUCH"))
? tr::lng_group_invite_no_room(tr::now)
: tr::lng_group_invite_bad_link(tr::now)));
}
}).send();
}
@@ -550,7 +550,7 @@ void ApiWrap::sendMessageFail(const RPCError &error) {
} else if (error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
const auto link = textcmdLink(
Core::App().createInternalLinkFull(qsl("spambot")),
lang(lng_cant_more_info));
tr::lng_cant_more_info(tr::now));
Ui::show(Box<InformBox>(lng_error_public_groups_denied(
lt_more_info,
link)));
@@ -1409,7 +1409,7 @@ void ApiWrap::migrateDone(
void ApiWrap::migrateFail(not_null<PeerData*> peer, const RPCError &error) {
const auto &type = error.type();
if (type == qstr("CHANNELS_TOO_MUCH")) {
Ui::show(Box<InformBox>(lang(lng_migrate_error)));
Ui::show(Box<InformBox>(tr::lng_migrate_error(tr::now)));
}
if (auto handlers = _migrateCallbacks.take(peer)) {
for (auto &handler : *handlers) {
@@ -2167,13 +2167,13 @@ void ApiWrap::joinChannel(not_null<ChannelData*> channel) {
if (error.type() == qstr("CHANNEL_PRIVATE")
|| error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")
|| error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
Ui::show(Box<InformBox>(lang(channel->isMegagroup()
? lng_group_not_accessible
: lng_channel_not_accessible)));
Ui::show(Box<InformBox>(channel->isMegagroup()
? tr::lng_group_not_accessible(tr::now)
: tr::lng_channel_not_accessible(tr::now)));
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
Ui::show(Box<InformBox>(lang(lng_join_channel_error)));
Ui::show(Box<InformBox>(tr::lng_join_channel_error(tr::now)));
} else if (error.type() == qstr("USERS_TOO_MUCH")) {
Ui::show(Box<InformBox>(lang(lng_group_full)));
Ui::show(Box<InformBox>(tr::lng_group_full(tr::now)));
}
_channelAmInRequests.remove(channel);
}).send();
@@ -2826,7 +2826,7 @@ void ApiWrap::requestAttachedStickerSets(not_null<PhotoData*> photo) {
MTP_inputStickeredMediaPhoto(photo->mtpInput())
)).done([=](const MTPVector<MTPStickerSetCovered> &result) {
if (result.v.isEmpty()) {
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
return;
} else if (result.v.size() > 1) {
Ui::show(Box<StickersBox>(result));
@@ -2847,7 +2847,7 @@ void ApiWrap::requestAttachedStickerSets(not_null<PhotoData*> photo) {
LayerOption::KeepOther);
}).fail([=](const RPCError &error) {
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
}).send();
}
@@ -3377,7 +3377,7 @@ void ApiWrap::requestRecentStickersWithHash(int32 hash) {
auto &d = result.c_messages_recentStickers();
Stickers::SpecialSetReceived(
Stickers::CloudRecentSetId,
lang(lng_recent_stickers),
tr::lng_recent_stickers(tr::now),
d.vstickers.v,
d.vhash.v,
d.vpacks.v,
@@ -4864,7 +4864,7 @@ void ApiWrap::editUploadedFile(
item->returnSavedMedia();
_session->data().sendHistoryChangeNotifications();
Ui::show(
Box<InformBox>(lang(lng_edit_media_invalid_file)),
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)),
LayerOption::KeepOther);
} else {
sendMessageFail(error);