mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Use tr:: instead of lang().
This commit is contained in:
@@ -107,7 +107,7 @@ EditCaptionBox::EditCaptionBox(
|
||||
|
||||
if (doc) {
|
||||
const auto nameString = doc->isVoiceMessage()
|
||||
? lang(lng_media_audio)
|
||||
? tr::lng_media_audio(tr::now)
|
||||
: doc->composeNameString();
|
||||
setName(nameString, doc->size);
|
||||
_isImage = doc->isImage();
|
||||
@@ -262,7 +262,7 @@ EditCaptionBox::EditCaptionBox(
|
||||
this,
|
||||
object_ptr<Ui::Checkbox>(
|
||||
this,
|
||||
lang(lng_send_file),
|
||||
tr::lng_send_file(tr::now),
|
||||
false,
|
||||
st::defaultBoxCheckbox),
|
||||
st::editMediaCheckboxMargins);
|
||||
@@ -481,7 +481,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||
const auto isValidFile = [](QString mimeType) {
|
||||
if (mimeType == qstr("image/webp")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(lang(lng_edit_media_invalid_file)),
|
||||
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)),
|
||||
LayerOption::KeepOther);
|
||||
return false;
|
||||
}
|
||||
@@ -509,7 +509,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||
if (ranges::find(albumMimes, file->mime) == end(albumMimes)
|
||||
|| file->type == Storage::PreparedFile::AlbumType::None) {
|
||||
Ui::show(
|
||||
Box<InformBox>(lang(lng_edit_media_album_error)),
|
||||
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
|
||||
LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
@@ -539,7 +539,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||
});
|
||||
if (!valid) {
|
||||
Ui::show(
|
||||
Box<InformBox>(lang(lng_edit_media_album_error)),
|
||||
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
|
||||
LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
@@ -563,7 +563,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||
: QStringList(FileDialog::AllFilesFilter());
|
||||
FileDialog::GetOpenPath(
|
||||
this,
|
||||
lang(lng_choose_file),
|
||||
tr::lng_choose_file(tr::now),
|
||||
filters.join(qsl(";;")),
|
||||
crl::guard(this, callback));
|
||||
};
|
||||
@@ -674,7 +674,7 @@ bool EditCaptionBox::fileFromClipboard(not_null<const QMimeData*> data) {
|
||||
if (list.files.front().type == Storage::PreparedFile::AlbumType::None
|
||||
&& _isAlbum) {
|
||||
Ui::show(
|
||||
Box<InformBox>(lang(lng_edit_media_album_error)),
|
||||
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
|
||||
LayerOption::KeepOther);
|
||||
return false;
|
||||
}
|
||||
@@ -827,7 +827,7 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
|
||||
} else {
|
||||
p.setFont(st::boxTitleFont);
|
||||
p.setPen(st::boxTextFg);
|
||||
p.drawTextLeft(_field->x(), st::boxPhotoPadding.top(), width(), lang(lng_edit_message));
|
||||
p.drawTextLeft(_field->x(), st::boxPhotoPadding.top(), width(), tr::lng_edit_message(tr::now));
|
||||
}
|
||||
|
||||
if (!_error.isEmpty()) {
|
||||
@@ -875,7 +875,7 @@ void EditCaptionBox::save() {
|
||||
|
||||
const auto item = Auth().data().message(_msgId);
|
||||
if (!item) {
|
||||
_error = lang(lng_edit_deleted);
|
||||
_error = tr::lng_edit_deleted(tr::now);
|
||||
update();
|
||||
return;
|
||||
}
|
||||
@@ -945,7 +945,7 @@ bool EditCaptionBox::saveFail(const RPCError &error) {
|
||||
_saveRequestId = 0;
|
||||
QString err = error.type();
|
||||
if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) {
|
||||
_error = lang(lng_edit_error);
|
||||
_error = tr::lng_edit_error(tr::now);
|
||||
} else if (err == qstr("MESSAGE_NOT_MODIFIED")) {
|
||||
closeBox();
|
||||
return true;
|
||||
@@ -953,7 +953,7 @@ bool EditCaptionBox::saveFail(const RPCError &error) {
|
||||
_field->setFocus();
|
||||
_field->showError();
|
||||
} else {
|
||||
_error = lang(lng_edit_error);
|
||||
_error = tr::lng_edit_error(tr::now);
|
||||
}
|
||||
update();
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user