2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +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

@@ -672,7 +672,7 @@ void Application::startLocalStorage() {
void Application::forceLogOut(const TextWithEntities &explanation) {
const auto box = Ui::show(Box<InformBox>(
explanation,
lang(lng_passcode_logout)));
tr::lng_passcode_logout(tr::now)));
box->setCloseByEscape(false);
box->setCloseByOutsideClick(false);
connect(box, &QObject::destroyed, [=] {

View File

@@ -126,7 +126,7 @@ void Changelogs::addLocalLogs() {
lt_version,
QString::fromLatin1(AppVersionStr),
lt_changes,
lang(lng_new_version_minor),
tr::lng_new_version_minor(tr::now),
lt_link,
qsl("https://desktop.telegram.org/changelog"));
addLocalLog(text.trimmed());

View File

@@ -100,7 +100,9 @@ UrlClickHandler::UrlClickHandler(const QString &url, bool fullDisplayed)
}
QString UrlClickHandler::copyToClipboardContextItemText() const {
return lang(isEmail() ? lng_context_copy_email : lng_context_copy_link);
return isEmail()
? tr::lng_context_copy_email(tr::now)
: tr::lng_context_copy_link(tr::now);
}
QString UrlClickHandler::url() const {
@@ -161,8 +163,8 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
: url;
Ui::show(
Box<ConfirmBox>(
lang(lng_open_this_link) + qsl("\n\n") + displayUrl,
lang(lng_open_link),
tr::lng_open_this_link(tr::now) + qsl("\n\n") + displayUrl,
tr::lng_open_link(tr::now),
[=] { Ui::hideLayer(); open(); }),
LayerOption::KeepOther);
} else {
@@ -192,7 +194,7 @@ void BotGameUrlClickHandler::onClick(ClickContext context) const {
};
Ui::show(Box<ConfirmBox>(
lng_allow_bot_pass(lt_bot_name, _bot->name),
lang(lng_allow_bot),
tr::lng_allow_bot(tr::now),
callback));
}
}
@@ -202,7 +204,7 @@ auto HiddenUrlClickHandler::getTextEntity() const -> TextEntity {
}
QString MentionClickHandler::copyToClipboardContextItemText() const {
return lang(lng_context_copy_mention);
return tr::lng_context_copy_mention(tr::now);
}
void MentionClickHandler::onClick(ClickContext context) const {
@@ -241,7 +243,7 @@ QString MentionNameClickHandler::tooltip() const {
}
QString HashtagClickHandler::copyToClipboardContextItemText() const {
return lang(lng_context_copy_hashtag);
return tr::lng_context_copy_hashtag(tr::now);
}
void HashtagClickHandler::onClick(ClickContext context) const {
@@ -256,7 +258,7 @@ auto HashtagClickHandler::getTextEntity() const -> TextEntity {
}
QString CashtagClickHandler::copyToClipboardContextItemText() const {
return lang(lng_context_copy_hashtag);
return tr::lng_context_copy_hashtag(tr::now);
}
void CashtagClickHandler::onClick(ClickContext context) const {

View File

@@ -56,7 +56,7 @@ bool JoinGroupByHash(const Match &match, const QVariant &context) {
return;
}
Core::App().hideMediaView();
Ui::show(Box<InformBox>(lang(lng_group_invite_bad_link)));
Ui::show(Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
});
return true;
}
@@ -246,7 +246,7 @@ bool ResolvePrivatePost(const Match &match, const QVariant &context) {
msgId);
};
const auto fail = [=] {
Ui::show(Box<InformBox>(lang(lng_error_post_link_invalid)));
Ui::show(Box<InformBox>(tr::lng_error_post_link_invalid(tr::now)));
};
const auto auth = &Auth();
if (const auto channel = auth->data().channelLoaded(channelId)) {
@@ -292,7 +292,7 @@ bool HandleUnknown(const Match &match, const QVariant &context) {
};
*box = Ui::show(Box<ConfirmBox>(
text,
lang(lng_menu_update),
tr::lng_menu_update(tr::now),
callback));
} else {
Ui::show(Box<InformBox>(text));