diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 5284a9b1ff..73d9a81a03 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -2696,6 +2696,7 @@ Unused sets are archived when you add more."; "Conversation.ViewChannel" = "VIEW CHANNEL"; "Conversation.ViewGroup" = "VIEW GROUP"; +"Conversation.ViewBot" = "VIEW BOT"; "GroupInfo.ActionPromote" = "Promote"; "GroupInfo.ActionRestrict" = "Restrict"; @@ -5719,7 +5720,7 @@ Sorry for the inconvenience."; "VoiceChat.PanelJoin" = "Join"; "VoiceChat.Title" = "Voice Chat"; -"VoiceChatChannel.Title" = "Voice Chat"; +"VoiceChatChannel.Title" = "Live Stream"; "VoiceChat.InviteMember" = "Invite Member"; "VoiceChat.UserInvited" = "You invited **%@** to the voice chat"; @@ -6715,3 +6716,12 @@ Sorry for the inconvenience."; "Channel.AdminLog.MessageChangedThemeSet" = "%1$@ changed chat theme to %2$@"; "Channel.AdminLog.MessageChangedThemeRemove" = "%1$@ disabled chat theme"; + +"SponsoredMessageMenu.Info" = "What are sponsored\nmessages?"; +"SponsoredMessageInfo.Text" = "See https://telegram.org"; +"SponsoredMessageInfo.Action" = "Learn More"; +"SponsoredMessageInfo.ActionUrl" = "https://telegram.org"; + +"Chat.NavigationNoChannels" = "You have no unread channels"; + +"Message.SponsoredLabel" = "sponsored"; diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index 10b45b366a..7a48c4c9dd 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -295,11 +295,20 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState let presentationData = context.sharedContext.currentPresentationData.with { $0 } var actions: [ContextMenuItem] = [] - //TODO:localize - actions.append(.action(ContextMenuActionItem(text: "What are sponsored\nmessages?", textColor: .primary, textLayout: .twoLinesMax, textFont: .custom(Font.regular(presentationData.listsFontSize.baseDisplaySize - 1.0)), badge: nil, icon: { theme in + actions.append(.action(ContextMenuActionItem(text: presentationData.strings.SponsoredMessageMenu_Info, textColor: .primary, textLayout: .twoLinesMax, textFont: .custom(Font.regular(presentationData.listsFontSize.baseDisplaySize - 1.0)), badge: nil, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor) }, iconSource: nil, action: { _, f in f(.default) + + controllerInteraction.presentController(textAlertController(context: context, title: nil, text: presentationData.strings.SponsoredMessageInfo_Text, actions: [ + TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: { + }), + TextAlertAction(type: .defaultAction, title: presentationData.strings.SponsoredMessageInfo_Action, action: { + context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: presentationData.strings.SponsoredMessageInfo_ActionUrl, forceExternal: true, presentationData: presentationData, navigationController: controllerInteraction.navigationController(), dismissInput: { + controllerInteraction.navigationController()?.view.endEditing(true) + }) + }), + ]), nil) }))) actions.append(.separator) diff --git a/submodules/TelegramUI/Sources/ChatMessageWebpageBubbleContentNode.swift b/submodules/TelegramUI/Sources/ChatMessageWebpageBubbleContentNode.swift index 3b131e9dae..140e3b074a 100644 --- a/submodules/TelegramUI/Sources/ChatMessageWebpageBubbleContentNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageWebpageBubbleContentNode.swift @@ -328,8 +328,7 @@ final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContentNode { } if let author = item.message.author as? TelegramUser, author.botInfo != nil { - //TODO:localize - actionTitle = "VIEW BOT" + actionTitle = item.presentationData.strings.Conversation_ViewBot } else if let author = item.message.author as? TelegramChannel, case .group = author.info { actionTitle = item.presentationData.strings.Conversation_ViewGroup } else { diff --git a/submodules/TelegramUI/Sources/ChatOverscrollControl.swift b/submodules/TelegramUI/Sources/ChatOverscrollControl.swift index fe2646605e..b642e42e96 100644 --- a/submodules/TelegramUI/Sources/ChatOverscrollControl.swift +++ b/submodules/TelegramUI/Sources/ChatOverscrollControl.swift @@ -494,7 +494,8 @@ final class AvatarComponent: Component { func update(component: AvatarComponent, availableSize: CGSize, transition: Transition) -> CGSize { self.avatarNode.frame = CGRect(origin: CGPoint(), size: availableSize) - self.avatarNode.setPeer(context: component.context, theme: component.context.sharedContext.currentPresentationData.with({ $0 }).theme, peer: component.peer, synchronousLoad: true) + let theme = component.context.sharedContext.currentPresentationData.with({ $0 }).theme + self.avatarNode.setPeer(context: component.context, theme: theme, peer: component.peer, emptyColor: theme.list.mediaPlaceholderColor, synchronousLoad: true) if let badge = component.badge { let badgeView: ComponentHostView @@ -858,8 +859,7 @@ final class OverscrollContentsComponent: Component { if let peer = component.peer { titleText = peer.compactDisplayTitle } else { - //TODO:localize - titleText = "You have no unread channels" + titleText = component.context.sharedContext.currentPresentationData.with({ $0 }).strings.Chat_NavigationNoChannels } self.titleNode.attributedText = NSAttributedString(string: titleText, font: Font.semibold(13.0), textColor: component.foregroundColor) let titleSize = self.titleNode.updateLayout(CGSize(width: availableSize.width - 32.0, height: 100.0)) diff --git a/submodules/TelegramUI/Sources/StringForMessageTimestampStatus.swift b/submodules/TelegramUI/Sources/StringForMessageTimestampStatus.swift index dde2995516..f869b52d15 100644 --- a/submodules/TelegramUI/Sources/StringForMessageTimestampStatus.swift +++ b/submodules/TelegramUI/Sources/StringForMessageTimestampStatus.swift @@ -30,8 +30,7 @@ private func dateStringForDay(strings: PresentationStrings, dateTimeFormat: Pres func stringForMessageTimestampStatus(accountPeerId: PeerId, message: Message, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, strings: PresentationStrings, format: MessageTimestampStatusFormat = .regular, reactionCount: Int) -> String { if message.adAttribute != nil { - //TODO:localize - return "sponsored" + return strings.Message_SponsoredLabel } let timestamp: Int32