Fix translation of replies to web-page previews.

This commit is contained in:
John Preston 2023-01-30 19:33:52 +04:00
parent f4455663fc
commit 5ba7b3906c

View file

@ -1254,7 +1254,7 @@ ItemPreview MediaLocation::toPreview(ToPreviewOptions options) const {
TextWithEntities MediaLocation::notificationText() const { TextWithEntities MediaLocation::notificationText() const {
return WithCaptionNotificationText( return WithCaptionNotificationText(
tr::lng_maps_point(tr::now), tr::lng_maps_point(tr::now),
{ .text = _title}); { .text = _title });
} }
QString MediaLocation::pinnedTextSubstring() const { QString MediaLocation::pinnedTextSubstring() const {
@ -1442,7 +1442,10 @@ bool MediaWebPage::replyPreviewLoaded() const {
} }
ItemPreview MediaWebPage::toPreview(ToPreviewOptions options) const { ItemPreview MediaWebPage::toPreview(ToPreviewOptions options) const {
return { .text = notificationText() }; return { .text = options.translated
? parent()->translatedText()
: parent()->originalText()
};
} }
TextWithEntities MediaWebPage::notificationText() const { TextWithEntities MediaWebPage::notificationText() const {