From cebadbbf3d3956ba78a2231dc356b0aacd2ad229 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Fri, 14 Nov 2025 01:34:10 +0800 Subject: [PATCH] Stories --- .../Telegram-iOS/en.lproj/Localizable.strings | 36 +++++++++++++++++++ .../Sources/Node/ChatListItem.swift | 3 +- .../Sources/ChatSendStarsScreen.swift | 26 +++++--------- .../Sources/MessageInputPanelComponent.swift | 3 +- .../AvatarStoryIndicatorComponent.swift | 1 - .../Sources/StoryAuthorInfoComponent.swift | 3 +- .../StoryContentLiveChatComponent.swift | 8 ++--- .../Sources/StoryItemContentComponent.swift | 33 +++++++++++------ .../Sources/StoryItemImageView.swift | 9 +++++ .../StoryItemSetContainerComponent.swift | 18 ++++------ ...StoryItemSetContainerViewSendMessage.swift | 5 ++- .../Sources/StoryPeerListItemComponent.swift | 4 +-- .../Sources/ChatControllerAdminBanUsers.swift | 17 +++++---- 13 files changed, 100 insertions(+), 66 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 89f15877f4..b57172753d 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -15372,3 +15372,39 @@ Error: %8$@"; "Notification.StarGift.Subtitle.OtherNoConvert" = "We'll notify %1$@ once it becomes eligible for unique upgrades."; "Gift.View.NoConvertDescription" = "We'll notify you once it becomes eligible for unique upgrades."; "Gift.View.OtherNoConvertDescription" = "We'll notify %1$@ once it becomes eligible for unique upgrades."; + +"Story.LiveBadge" = "LIVE"; +"SendStarReactions.LiveStreamPerk1Title" = "pin in chat"; +"SendStarReactions.LiveStreamPerk2Title" = "characters"; +"SendStarReactions.LiveStreamPerk3Title" = "emoji"; +"SendStarReactions.LiveStreamMessageTitle" = "Highlight and Pin"; +"SendStarReactions.LiveStreamReactionText" = "Highlight and pin a message\nby adding Stars for **%@**"; +"SendStarReactions.LiveStreamMessageText" = "Highlight and pin a message\nby adding Stars for **%@**"; +"SendStarReactions.OwnLiveStreamCloseButton" = "Close"; +"SendStarReactions.OwnLiveStreamInfoText" = "You can't send star reactions to own story."; +"SendStarReactions.LiveStreamActionButton" = "Add # %@"; + +"LiveStream.CommentsDisabledPlaceholder" = "Comments disabled"; +"LiveStream.LoadingStatus" = "loading..."; +"LiveStream.StoryViewerEmpty" = "no viewers"; +"LiveStream.StoryViewerCount_1" = "1 watching"; +"LiveStream.StoryViewerCount_any" = "%@ watching"; + +"LiveStream.InputPlaceholder" = "Comment"; + +"Story.ContextMenuPip" = "Minimize"; +"Story.ContextMenuLiveSettings" = "Live Settings"; + +"LiveStream.InputContextMenuAddStars" = "Add Stars"; +"LiveStream.InputContextMenuEditStars" = "Edit Stars"; +"LiveStream.InputContextMenuRemoveStars" = "Remove Stars"; + +"Reminders.DeleteRepeatingTitle" = "Delete Repeating Reminder"; +"Reminders.DeleteRepeatingText" = "Are you sure you want to delete this reminder? This is a repeating reminder."; +"Reminders.DeleteRepeatingActionSingle" = "Delete This Reminder Only"; +"Reminders.DeleteRepeatingActionMultiple" = "Delete All Future Reminders"; + +"ScheduledMessages.DeleteRepeatingTitle" = "Delete Repeating Message"; +"ScheduledMessages.DeleteRepeatingText" = "Are you sure you want to delete this scheduled message? This is a repeating message."; +"ScheduledMessages.DeleteRepeatingActionSingle" = "Delete This Message Only"; +"ScheduledMessages.DeleteRepeatingActionMultiple" = "Delete All Future Messages"; diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 2ebe86f12e..46974fd940 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -1809,8 +1809,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { self.avatarNode.view.addSubview(avatarLiveBadge.outline) self.avatarNode.view.addSubview(avatarLiveBadge.foreground) - //TODO:localize - let liveString = NSAttributedString(string: "LIVE", font: Font.semibold(10.0), textColor: .white) + let liveString = NSAttributedString(string: item.presentationData.strings.Story_LiveBadge, font: Font.semibold(10.0), textColor: .white) let liveStringBounds = liveString.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: .usesLineFragmentOrigin, context: nil) let liveBadgeSize = CGSize(width: ceil(liveStringBounds.width) + 4.0 * 2.0, height: ceil(liveStringBounds.height) + 2.0 * 2.0) avatarLiveBadge.foreground.image = generateImage(liveBadgeSize, rotatedContext: { size, context in diff --git a/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift b/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift index 580ec70162..83fa49c7be 100644 --- a/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift +++ b/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift @@ -1750,23 +1750,22 @@ private final class ChatSendStarsScreenComponent: Component { switch component.initialData.subjectInitialData { case let .liveStreamMessage(liveStreamMessageData): - //TODO:localize let params = GroupCallMessagesContext.getStarAmountParamMapping(params: liveStreamMessageData.liveChatMessageParams, value: Int64(self.amount.realValue)) var perks: [(String, String)] = [] perks.append(( shortTimeIntervalString(strings: environment.strings, value: Int32(params.period), useLargeFormat: false), - "pin in chat" + environment.strings.SendStarReactions_LiveStreamPerk1Title )) perks.append(( "\(params.maxLength)", - "characters" + environment.strings.SendStarReactions_LiveStreamPerk2Title )) perks.append(( "\(params.emojiCount)", - "emoji" + environment.strings.SendStarReactions_LiveStreamPerk3Title )) contentHeight += 54.0 @@ -1932,8 +1931,7 @@ private final class ChatSendStarsScreenComponent: Component { case .react: titleText = environment.strings.SendStarReactions_Title case .liveStreamMessage: - //TODO:localize - titleText = "Highlight and Pin" + titleText = environment.strings.SendStarReactions_LiveStreamMessageTitle } let titleSize = title.update( @@ -1974,8 +1972,7 @@ private final class ChatSendStarsScreenComponent: Component { switch component.initialData.subjectInitialData { case let .react(reactData): if case .liveStream = reactData.reactSubject { - //TODO:localize - text = "Highlight and pin a message\nby adding Stars for **\(reactData.peer.displayTitle(strings: environment.strings, displayOrder: .firstLast))**." + text = environment.strings.SendStarReactions_LiveStreamReactionText(reactData.peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)).string } else { if let currentSentAmount = reactData.currentSentAmount { text = environment.strings.SendStarReactions_TextSentStars(Int32(clamping: currentSentAmount)) @@ -1984,8 +1981,7 @@ private final class ChatSendStarsScreenComponent: Component { } } case let .liveStreamMessage(liveStreamMessageData): - //TODO:localize - text = "Highlight and pin a message\nby adding Stars for **\(liveStreamMessageData.peer.displayTitle(strings: environment.strings, displayOrder: .firstLast))**." + text = environment.strings.SendStarReactions_LiveStreamMessageText(liveStreamMessageData.peer.displayTitle(strings: environment.strings, displayOrder: .firstLast)).string } let addDescriptionText: () -> Void = { @@ -2508,14 +2504,12 @@ private final class ChatSendStarsScreenComponent: Component { switch component.initialData.subjectInitialData { case .react: if isOnlyDisplay { - //TODO:localize - buttonString = "Close" + buttonString = environment.strings.SendStarReactions_OwnLiveStreamCloseButton } else { buttonString = environment.strings.SendStarReactions_SendButtonTitle("\(self.amount.realValue)").string } case .liveStreamMessage: - //TODO:localize - buttonString = "Add # \(self.amount.realValue)" + buttonString = environment.strings.SendStarReactions_LiveStreamActionButton("\(self.amount.realValue)").string } let buttonAttributedString = NSMutableAttributedString(string: buttonString, font: Font.semibold(17.0), textColor: environment.theme.list.itemCheckColors.foregroundColor, paragraphAlignment: .center) if let range = buttonAttributedString.string.range(of: "#"), let starImage = self.cachedStarImage?.0 { @@ -2579,7 +2573,6 @@ private final class ChatSendStarsScreenComponent: Component { case let .react(reactData): purchasePurpose = .reactions(peerId: reactData.peer.id, requiredStars: Int64(self.amount.realValue)) case let .liveStreamMessage(liveStreamMessageData): - //TODO:localize purchasePurpose = .reactions(peerId: liveStreamMessageData.peer.id, requiredStars: Int64(self.amount.realValue)) } @@ -2641,11 +2634,10 @@ private final class ChatSendStarsScreenComponent: Component { var buttonDescriptionTextSize: CGSize? if case .react = component.initialData.subjectInitialData { - //TODO:localize buttonDescriptionTextSize = self.buttonDescriptionText.update( transition: .immediate, component: AnyComponent(MultilineTextComponent( - text: .markdown(text: isOnlyDisplay ? "You can't send star reactions to own story." : environment.strings.SendStarReactions_TermsOfServiceFooter, attributes: MarkdownAttributes( + text: .markdown(text: isOnlyDisplay ? environment.strings.SendStarReactions_OwnLiveStreamInfoText : environment.strings.SendStarReactions_TermsOfServiceFooter, attributes: MarkdownAttributes( body: MarkdownAttributeSet(font: Font.regular(13.0), textColor: environment.theme.list.itemSecondaryTextColor), bold: MarkdownAttributeSet(font: Font.semibold(13.0), textColor: environment.theme.list.itemSecondaryTextColor), link: MarkdownAttributeSet(font: Font.regular(13.0), textColor: environment.theme.list.itemAccentColor), diff --git a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift index f7c526d7c4..a8261d8d72 100644 --- a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift +++ b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift @@ -1110,8 +1110,7 @@ public final class MessageInputPanelComponent: Component { rightAction: rightAction, secondaryRightAction: secondaryRightAction, sendAsConfiguration: component.liveChatState?.isEnabled == true ? sendAsConfiguration : nil, - //TODO:localize - placeholder: (component.liveChatState == nil || component.liveChatState?.isEnabled == true) ? placeholder : "Comments are disabled", + placeholder: (component.liveChatState == nil || component.liveChatState?.isEnabled == true) ? placeholder : component.strings.LiveStream_CommentsDisabledPlaceholder, isEnabled: (component.liveChatState == nil || component.liveChatState?.isEnabled == true), paidMessagePrice: component.sendPaidMessageStars, sendColor: component.sendPaidMessageStars.flatMap { value in diff --git a/submodules/TelegramUI/Components/Stories/AvatarStoryIndicatorComponent/Sources/AvatarStoryIndicatorComponent.swift b/submodules/TelegramUI/Components/Stories/AvatarStoryIndicatorComponent/Sources/AvatarStoryIndicatorComponent.swift index 117f3eb68b..e83aae1c76 100644 --- a/submodules/TelegramUI/Components/Stories/AvatarStoryIndicatorComponent/Sources/AvatarStoryIndicatorComponent.swift +++ b/submodules/TelegramUI/Components/Stories/AvatarStoryIndicatorComponent/Sources/AvatarStoryIndicatorComponent.swift @@ -666,7 +666,6 @@ public final class AvatarStoryIndicatorComponent: Component { let inactiveColors: [CGColor] if component.hasLiveItems { - //TODO:localize activeColors = [UIColor(rgb: 0xFF3777).cgColor, UIColor(rgb: 0xFF2D55).cgColor] } else if component.hasUnseenCloseFriendsItems { activeColors = component.colors.unseenCloseFriendsColors.map(\.cgColor) diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryAuthorInfoComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryAuthorInfoComponent.swift index bc4ff30a48..190d9be6c6 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryAuthorInfoComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryAuthorInfoComponent.swift @@ -278,8 +278,7 @@ final class StoryAuthorInfoComponent: Component { liveBadgeView = UIImageView() self.liveBadgeView = liveBadgeView self.addSubview(liveBadgeView) - //TODO:localize - let liveString = NSAttributedString(string: "LIVE", font: Font.semibold(10.0), textColor: .white) + let liveString = NSAttributedString(string: component.strings.Story_LiveBadge, font: Font.semibold(10.0), textColor: .white) let liveStringBounds = liveString.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: .usesLineFragmentOrigin, context: nil) let liveBadgeSize = CGSize(width: ceil(liveStringBounds.width) + 3.0 * 2.0, height: ceil(liveStringBounds.height) + 1.0 * 2.0) liveBadgeView.image = generateImage(liveBadgeSize, rotatedContext: { size, context in diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContentLiveChatComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContentLiveChatComponent.swift index 6c2d63e01c..ef2c38820a 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContentLiveChatComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContentLiveChatComponent.swift @@ -421,9 +421,8 @@ final class StoryContentLiveChatComponent: Component { } var items: [ContextMenuItem] = [] - //TODO:localize if !isPinned { - items.append(.action(ContextMenuActionItem(text: "Copy", textColor: .primary, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Copy"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.Conversation_ContextMenuCopy, textColor: .primary, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Copy"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in guard let self else { return } @@ -459,13 +458,12 @@ final class StoryContentLiveChatComponent: Component { isMessageFromAdmin = true } - //TODO:localize if !isMyMessage, let author = message.author { let openProfileString: String if case .channel = author { - openProfileString = "Open Channel" + openProfileString = presentationData.strings.Conversation_ContextMenuOpenChannel } else { - openProfileString = "Open Profile" + openProfileString = presentationData.strings.Conversation_ContextMenuOpenProfile } items.append(.action(ContextMenuActionItem(text: openProfileString, textColor: .primary, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/User"), color: theme.contextMenu.primaryColor) }, action: { [weak self] c, _ in guard let self else { diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift index 75bfda1137..f020486616 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift @@ -831,9 +831,8 @@ final class StoryItemContentComponent: Component { selectedMedia = component.item.media messageMedia = selectedMedia - //TODO:localize if self.customSubtitle == nil { - self.customSubtitle = "loading..." + self.customSubtitle = component.strings.LiveStream_LoadingStatus } } else if !component.preferHighQuality, !component.item.isMy, let alternativeMediaValue = component.item.alternativeMediaList.first { selectedMedia = alternativeMediaValue @@ -943,6 +942,25 @@ final class StoryItemContentComponent: Component { } } + if let messageMedia, case .liveStream = messageMedia { + self.imageView.update( + context: component.context, + strings: component.strings, + peer: component.peer, + storyId: component.item.id, + media: messageMedia, + size: availableSize, + isCaptureProtected: component.item.isForwardingDisabled, + attemptSynchronous: synchronousLoad, + transition: transition + ) + if !self.contentLoaded || component.isVideoBuffering { + self.imageView.isHidden = false + } else { + self.imageView.isHidden = true + } + } + if case let .liveStream(liveStream) = messageMedia, let mediaStreamCall = self.mediaStreamCall { var mediaStreamTransition = transition let mediaStream: ComponentView @@ -1188,7 +1206,6 @@ final class StoryItemContentComponent: Component { guard let self, let component = self.component, let environment = self.environment else { return } - //TODO:localize let subtitle: String if let members { var totalCount = members.totalCount @@ -1196,12 +1213,12 @@ final class StoryItemContentComponent: Component { totalCount -= 1 } if totalCount == 0 && component.isEmbeddedInCamera { - subtitle = "no viewers" + subtitle = component.strings.LiveStream_StoryViewerEmpty } else { - subtitle = "\(max(1, totalCount)) watching" + subtitle = component.strings.LiveStream_StoryViewerCount(Int32(max(1, totalCount))) } } else { - subtitle = "loading..." + subtitle = component.strings.LiveStream_LoadingStatus } if self.customSubtitle != subtitle { self.customSubtitle = subtitle @@ -1228,10 +1245,6 @@ final class StoryItemContentComponent: Component { } } - if video != nil { - print("updating with video") - } - if !self.isUpdating { self.state?.updated(transition: .immediate) } diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemImageView.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemImageView.swift index 6e23b837d0..a5dcac6959 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemImageView.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemImageView.swift @@ -220,6 +220,15 @@ final class StoryItemImageView: UIView { }) } } + case .liveStream: + dimensions = CGSize(width: 128.0, height: 128.0) + if isMediaUpdated, let thumbnailData = peer.smallProfileImage?.immediateThumbnailData { + if let thumbnailData = decodeTinyThumbnail(data: thumbnailData), let thumbnailImage = UIImage(data: thumbnailData) { + if let image = blurredImage(thumbnailImage, radius: 10.0, iterations: 3) { + self.updateImage(image: image, isCaptureProtected: isCaptureProtected) + } + } + } default: break } diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift index ba82c6a495..a900f68c1d 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift @@ -2932,8 +2932,7 @@ public final class StoryItemSetContainerComponent: Component { let dateTimeFormat = component.context.sharedContext.currentPresentationData.with { $0 }.dateTimeFormat inputPlaceholder = .plain(component.strings.Chat_InputTextPaidMessagePlaceholder(" # \(presentationStringsFormattedNumber(Int32(sendPaidMessageStars.value), dateTimeFormat.groupingSeparator))").string) } else if case .liveStream = component.slice.item.storyItem.media { - //TODO:localize - inputPlaceholder = .plain("Comment") + inputPlaceholder = .plain(component.strings.LiveStream_InputPlaceholder) } else { inputPlaceholder = .plain(isGroup ? component.strings.Story_InputPlaceholderReplyInGroup : component.strings.Story_InputPlaceholderReplyPrivately) } @@ -6518,8 +6517,7 @@ public final class StoryItemSetContainerComponent: Component { }))) if isLiveStream { - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Minimize", icon: { theme in + items.append(.action(ContextMenuActionItem(text: component.strings.Story_ContextMenuPip, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Call/pip"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, a in a(.default) @@ -6661,8 +6659,7 @@ public final class StoryItemSetContainerComponent: Component { } if case .liveStream = component.slice.item.storyItem.media { - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Live Settings", icon: { theme in + items.append(.action(ContextMenuActionItem(text: component.strings.Story_ContextMenuLiveSettings, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Settings"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, a in a(.default) @@ -6852,8 +6849,7 @@ public final class StoryItemSetContainerComponent: Component { } if isLiveStream { - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Minimize", icon: { theme in + items.append(.action(ContextMenuActionItem(text: component.strings.Story_ContextMenuPip, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Call/pip"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, a in a(.default) @@ -6964,8 +6960,7 @@ public final class StoryItemSetContainerComponent: Component { }))) if channel.hasPermission(.postStories) { - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Live Settings", icon: { theme in + items.append(.action(ContextMenuActionItem(text: component.strings.Story_ContextMenuLiveSettings, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Settings"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, a in a(.default) @@ -7337,8 +7332,7 @@ public final class StoryItemSetContainerComponent: Component { } if isLiveStream { - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Minimize", icon: { theme in + items.append(.action(ContextMenuActionItem(text: component.strings.Story_ContextMenuPip, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Call/pip"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, a in a(.default) diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift index bdb3a76f85..236d4fb6b9 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift @@ -464,8 +464,7 @@ final class StoryItemSetContainerSendMessage: @unchecked(Sendable) { var items: [ContextMenuItem] = [] if case .liveStream = component.slice.item.storyItem.media { - //TODO:localize - items.append(.action(ContextMenuActionItem(text: self.currentLiveStreamMessageStars != nil ? "Edit Stars" : "Add Stars", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Text/AccessoryIconSuggestPost"), color: theme.contextMenu.primaryColor) + items.append(.action(ContextMenuActionItem(text: self.currentLiveStreamMessageStars != nil ? presentationData.strings.LiveStream_InputContextMenuEditStars : presentationData.strings.LiveStream_InputContextMenuAddStars, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Text/AccessoryIconSuggestPost"), color: theme.contextMenu.primaryColor) }, action: { [weak self, weak view] _, a in a(.default) @@ -485,7 +484,7 @@ final class StoryItemSetContainerSendMessage: @unchecked(Sendable) { } if canRemoveStars { - items.append(.action(ContextMenuActionItem(text: "Remove Stars", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/RemovePrice"), color: theme.contextMenu.primaryColor) + items.append(.action(ContextMenuActionItem(text: presentationData.strings.LiveStream_InputContextMenuRemoveStars, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/RemovePrice"), color: theme.contextMenu.primaryColor) }, action: { [weak self, weak view] _, a in a(.default) diff --git a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift index 2ddedf4605..cc012a79f3 100644 --- a/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryPeerListComponent/Sources/StoryPeerListItemComponent.swift @@ -822,8 +822,7 @@ public final class StoryPeerListItemComponent: Component { self.indicatorMaskUnseenLayer.addSublayer(avatarLiveBadgeMaskUnseenLayer) } if avatarLiveBadgeView.image == nil || themeUpdated { - //TODO:localize - let liveString = NSAttributedString(string: "LIVE", font: Font.semibold(10.0), textColor: .white) + let liveString = NSAttributedString(string: component.strings.Story_LiveBadge, font: Font.semibold(10.0), textColor: .white) let liveStringBounds = liveString.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: .usesLineFragmentOrigin, context: nil) let liveBadgeSize = CGSize(width: ceil(liveStringBounds.width) + 4.0 * 2.0, height: ceil(liveStringBounds.height) + 2.0 * 2.0) avatarLiveBadgeView.image = generateImage(liveBadgeSize, rotatedContext: { size, context in @@ -892,7 +891,6 @@ public final class StoryPeerListItemComponent: Component { let unseenColors: [CGColor] if component.hasLiveItems { - //TODO:localize unseenColors = [UIColor(rgb: 0xFF3777).cgColor, UIColor(rgb: 0xFF2D55).cgColor] } else if component.hasUnseenCloseFriendsItems { unseenColors = [component.theme.chatList.storyUnseenPrivateColors.topColor.cgColor, component.theme.chatList.storyUnseenPrivateColors.bottomColor.cgColor] diff --git a/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift b/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift index a2029d41cb..bbd1aa1113 100644 --- a/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift +++ b/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift @@ -438,17 +438,16 @@ extension ChatControllerImpl { let text: String let deleteOneAction: String let deleteAllAction: String - //TODO:localize if message.id.peerId == self.context.account.peerId { - title = "Delete Repeating Reminder" - text = "Are you sure you want to delete this reminder? This is a repeating reminder." - deleteOneAction = "Delete This Reminder Only" - deleteAllAction = "Delete All Future Reminders" + title = self.presentationData.strings.Reminders_DeleteRepeatingTitle + text = self.presentationData.strings.Reminders_DeleteRepeatingText + deleteOneAction = self.presentationData.strings.Reminders_DeleteRepeatingActionSingle + deleteAllAction = self.presentationData.strings.Reminders_DeleteRepeatingActionMultiple } else { - title = "Delete Repeating Message" - text = "Are you sure you want to delete this scheduled message? This is a repeating message." - deleteOneAction = "Delete This Message Only" - deleteAllAction = "Delete All Future Messages" + title = self.presentationData.strings.ScheduledMessages_DeleteRepeatingTitle + text = self.presentationData.strings.ScheduledMessages_DeleteRepeatingText + deleteOneAction = self.presentationData.strings.ScheduledMessages_DeleteRepeatingActionSingle + deleteAllAction = self.presentationData.strings.ScheduledMessages_DeleteRepeatingActionMultiple } self.present(standardTextAlertController( theme: AlertControllerTheme(presentationData: self.presentationData),