2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use tr:: instead of langFactory and __rich.

This commit is contained in:
John Preston
2019-06-18 18:53:27 +02:00
parent d1d98c3bb1
commit a7c8feaecb
103 changed files with 699 additions and 628 deletions

View File

@@ -41,8 +41,8 @@ SignupWidget::SignupWidget(QWidget *parent, Widget::Data *data) : Step(parent, d
setErrorCentered(true);
setTitleText(langFactory(lng_signup_title));
setDescriptionText(langFactory(lng_signup_desc));
setTitleText(tr::lng_signup_title());
setDescriptionText(tr::lng_signup_desc());
setMouseTracking(true);
}
@@ -122,7 +122,7 @@ void SignupWidget::nameSubmitDone(const MTPauth_Authorization &result) {
stopCheck();
auto &d = result.c_auth_authorization();
if (d.vuser.type() != mtpc_user || !d.vuser.c_user().is_self()) { // wtf?
showError(&Lang::Hard::ServerError);
showError(rpl::single(Lang::Hard::ServerError()));
return;
}
finish(d.vuser, _photo->takeResultImage());
@@ -131,7 +131,7 @@ void SignupWidget::nameSubmitDone(const MTPauth_Authorization &result) {
bool SignupWidget::nameSubmitFail(const RPCError &error) {
if (MTP::isFloodError(error)) {
stopCheck();
showError(langFactory(lng_flood_error));
showError(tr::lng_flood_error());
if (_invertOrder) {
_first->setFocus();
} else {
@@ -155,19 +155,18 @@ bool SignupWidget::nameSubmitFail(const RPCError &error) {
goBack();
return true;
} else if (err == "FIRSTNAME_INVALID") {
showError(langFactory(lng_bad_name));
showError(tr::lng_bad_name());
_first->setFocus();
return true;
} else if (err == "LASTNAME_INVALID") {
showError(langFactory(lng_bad_name));
showError(tr::lng_bad_name());
_last->setFocus();
return true;
}
if (Logs::DebugEnabled()) { // internal server error
auto text = err + ": " + error.description();
showError([text] { return text; });
showError(rpl::single(err + ": " + error.description()));
} else {
showError(&Lang::Hard::ServerError);
showError(rpl::single(Lang::Hard::ServerError()));
}
if (_invertOrder) {
_last->setFocus();
@@ -230,8 +229,8 @@ void SignupWidget::submit() {
}
}
QString SignupWidget::nextButtonText() const {
return lang(lng_intro_finish);
rpl::producer<QString> SignupWidget::nextButtonText() const {
return tr::lng_intro_finish();
}
} // namespace Intro