mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Remove all legacy global namespace langs.
This commit is contained in:
@@ -128,13 +128,27 @@ void CodeWidget::updateCallText() {
|
||||
switch (_callStatus) {
|
||||
case Widget::Data::CallStatus::Waiting: {
|
||||
if (_callTimeout >= 3600) {
|
||||
return lng_code_call(lt_minutes, qsl("%1:%2").arg(_callTimeout / 3600).arg((_callTimeout / 60) % 60, 2, 10, QChar('0')), lt_seconds, qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
||||
return tr::lng_code_call(
|
||||
tr::now,
|
||||
lt_minutes,
|
||||
qsl("%1:%2"
|
||||
).arg(_callTimeout / 3600
|
||||
).arg((_callTimeout / 60) % 60, 2, 10, QChar('0')),
|
||||
lt_seconds,
|
||||
qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
||||
} else {
|
||||
return lng_code_call(lt_minutes, QString::number(_callTimeout / 60), lt_seconds, qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
||||
return tr::lng_code_call(
|
||||
tr::now,
|
||||
lt_minutes,
|
||||
QString::number(_callTimeout / 60),
|
||||
lt_seconds,
|
||||
qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
||||
}
|
||||
} break;
|
||||
case Widget::Data::CallStatus::Calling: return tr::lng_code_calling(tr::now);
|
||||
case Widget::Data::CallStatus::Called: return tr::lng_code_called(tr::now);
|
||||
case Widget::Data::CallStatus::Calling:
|
||||
return tr::lng_code_calling(tr::now);
|
||||
case Widget::Data::CallStatus::Called:
|
||||
return tr::lng_code_called(tr::now);
|
||||
}
|
||||
return QString();
|
||||
})();
|
||||
|
@@ -52,7 +52,8 @@ PwdCheckWidget::PwdCheckWidget(
|
||||
if (_hint.isEmpty()) {
|
||||
_pwdHint->hide();
|
||||
} else {
|
||||
_pwdHint->setText(lng_signin_hint(lt_password_hint, _hint));
|
||||
_pwdHint->setText(
|
||||
tr::lng_signin_hint(tr::now, lt_password_hint, _hint));
|
||||
}
|
||||
_codeField->hide();
|
||||
_toPassword->hide();
|
||||
@@ -61,10 +62,16 @@ PwdCheckWidget::PwdCheckWidget(
|
||||
}
|
||||
|
||||
void PwdCheckWidget::refreshLang() {
|
||||
if (_toRecover) _toRecover->setText(tr::lng_signin_recover(tr::now));
|
||||
if (_toPassword) _toPassword->setText(tr::lng_signin_try_password(tr::now));
|
||||
if (_toRecover) {
|
||||
_toRecover->setText(tr::lng_signin_recover(tr::now));
|
||||
}
|
||||
if (_toPassword) {
|
||||
_toPassword->setText(
|
||||
tr::lng_signin_try_password(tr::now));
|
||||
}
|
||||
if (!_hint.isEmpty()) {
|
||||
_pwdHint->setText(lng_signin_hint(lt_password_hint, _hint));
|
||||
_pwdHint->setText(
|
||||
tr::lng_signin_hint(tr::now, lt_password_hint, _hint));
|
||||
}
|
||||
updateControlsGeometry();
|
||||
}
|
||||
|
@@ -373,22 +373,52 @@ void Widget::resetAccount() {
|
||||
|
||||
auto type = error.type();
|
||||
if (type.startsWith(qstr("2FA_CONFIRM_WAIT_"))) {
|
||||
auto seconds = type.mid(qstr("2FA_CONFIRM_WAIT_").size()).toInt();
|
||||
auto days = (seconds + 59) / 86400;
|
||||
auto hours = ((seconds + 59) % 86400) / 3600;
|
||||
auto minutes = ((seconds + 59) % 3600) / 60;
|
||||
auto when = lng_signin_reset_minutes(lt_count, minutes);
|
||||
const auto seconds = type.mid(qstr("2FA_CONFIRM_WAIT_").size()).toInt();
|
||||
const auto days = (seconds + 59) / 86400;
|
||||
const auto hours = ((seconds + 59) % 86400) / 3600;
|
||||
const auto minutes = ((seconds + 59) % 3600) / 60;
|
||||
auto when = tr::lng_signin_reset_minutes(
|
||||
tr::now,
|
||||
lt_count,
|
||||
minutes);
|
||||
if (days > 0) {
|
||||
auto daysCount = lng_signin_reset_days(lt_count, days);
|
||||
auto hoursCount = lng_signin_reset_hours(lt_count, hours);
|
||||
when = lng_signin_reset_in_days(lt_days_count, daysCount, lt_hours_count, hoursCount, lt_minutes_count, when);
|
||||
const auto daysCount = tr::lng_signin_reset_days(
|
||||
tr::now,
|
||||
lt_count,
|
||||
days);
|
||||
const auto hoursCount = tr::lng_signin_reset_hours(
|
||||
tr::now,
|
||||
lt_count,
|
||||
hours);
|
||||
when = tr::lng_signin_reset_in_days(
|
||||
tr::now,
|
||||
lt_days_count,
|
||||
daysCount,
|
||||
lt_hours_count,
|
||||
hoursCount,
|
||||
lt_minutes_count,
|
||||
when);
|
||||
} else if (hours > 0) {
|
||||
auto hoursCount = lng_signin_reset_hours(lt_count, hours);
|
||||
when = lng_signin_reset_in_hours(lt_hours_count, hoursCount, lt_minutes_count, when);
|
||||
const auto hoursCount = tr::lng_signin_reset_hours(
|
||||
tr::now,
|
||||
lt_count,
|
||||
hours);
|
||||
when = tr::lng_signin_reset_in_hours(
|
||||
tr::now,
|
||||
lt_hours_count,
|
||||
hoursCount,
|
||||
lt_minutes_count,
|
||||
when);
|
||||
}
|
||||
Ui::show(Box<InformBox>(lng_signin_reset_wait(lt_phone_number, App::formatPhone(getData()->phone), lt_when, when)));
|
||||
Ui::show(Box<InformBox>(tr::lng_signin_reset_wait(
|
||||
tr::now,
|
||||
lt_phone_number,
|
||||
App::formatPhone(getData()->phone),
|
||||
lt_when,
|
||||
when)));
|
||||
} else if (type == qstr("2FA_RECENT_CONFIRM")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_signin_reset_cancelled(tr::now)));
|
||||
Ui::show(Box<InformBox>(
|
||||
tr::lng_signin_reset_cancelled(tr::now)));
|
||||
} else {
|
||||
Ui::hideLayer();
|
||||
getStep()->showError(rpl::single(Lang::Hard::ServerError()));
|
||||
|
Reference in New Issue
Block a user