Use correct lang phrases for video messages.

This commit is contained in:
John Preston 2017-04-15 22:26:28 +03:00
parent de7c886008
commit 0ff299758a
4 changed files with 19 additions and 4 deletions

View File

@ -657,6 +657,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_action_pinned_media_video" = "a video";
"lng_action_pinned_media_audio" = "an audio file";
"lng_action_pinned_media_voice" = "a voice message";
"lng_action_pinned_media_video_message" = "a video message";
"lng_action_pinned_media_file" = "a file";
"lng_action_pinned_media_gif" = "a GIF animation";
"lng_action_pinned_media_contact" = "a contact information";
@ -810,6 +811,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
"lng_in_dlg_audio_file" = "Audio file";
"lng_in_dlg_contact" = "Contact";
"lng_in_dlg_audio" = "Voice message";
"lng_in_dlg_video_message" = "Video message";
"lng_in_dlg_file" = "File";
"lng_in_dlg_sticker" = "Sticker";
"lng_in_dlg_sticker_emoji" = "{emoji} Sticker";

View File

@ -2020,15 +2020,19 @@ HistoryTextState HistoryGif::getState(int x, int y, HistoryStateRequest request)
}
QString HistoryGif::notificationText() const {
return captionedNotificationText(qsl("GIF"), _caption);
return captionedNotificationText(mediaTypeString(), _caption);
}
QString HistoryGif::inDialogsText() const {
return captionedInDialogsText(qsl("GIF"), _caption);
return captionedInDialogsText(mediaTypeString(), _caption);
}
TextWithEntities HistoryGif::selectedText(TextSelection selection) const {
return captionedSelectedText(qsl("GIF"), _caption, selection);
return captionedSelectedText(mediaTypeString(), _caption, selection);
}
QString HistoryGif::mediaTypeString() const {
return _data->isRoundVideo() ? lang(lng_in_dlg_video_message) : qsl("GIF");
}
void HistoryGif::setStatusSize(int32 newSize) const {

View File

@ -555,6 +555,8 @@ protected:
}
private:
QString mediaTypeString() const;
gsl::not_null<DocumentData*> _data;
int32 _thumbw = 1;
int32 _thumbh = 1;

View File

@ -2115,7 +2115,14 @@ HistoryService::PreparedText HistoryService::preparePinnedText() {
case MediaTypeVideo: return lang(lng_action_pinned_media_video);
case MediaTypeContact: return lang(lng_action_pinned_media_contact);
case MediaTypeFile: return lang(lng_action_pinned_media_file);
case MediaTypeGif: return lang(lng_action_pinned_media_gif);
case MediaTypeGif: {
if (auto document = media->getDocument()) {
if (document->isRoundVideo()) {
return lang(lng_action_pinned_media_video_message);
}
}
return lang(lng_action_pinned_media_gif);
} break;
case MediaTypeSticker: {
auto emoji = static_cast<HistorySticker*>(media)->emoji();
if (emoji.isEmpty()) {