diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index f208f82f9f..4548ef4b0b 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -7910,3 +7910,19 @@ Sorry for the inconvenience."; "StickerPack.EmojiCount_any" = "%@ emoji"; "StickerSettings.EmojiContextInfo" = "If you archive an emoji set, you can quickly restore it later from the Archived Emoji section."; + +"StickersList.EmojiItem" = "Custom Emoji"; +"StickersList.ArchivedEmojiItem" = "Archived Emoji"; + +"EmojiInput.UnlockPack" = "Unlock %@"; +"EmojiInput.AddPack" = "Add %@"; +"EmojiInput.PanelTitlePremium" = "Premium"; +"EmojiInput.PanelTitleEmoji" = "Emoji"; +"EmojiInput.PanelTitleRecent" = "Recent"; + +"EmojiInput.SectionTitleEmoji" = "Emoji"; +"EmojiInput.SectionTitleFavoriteStickers" = "Favorite Stickers"; +"EmojiInput.SectionTitlePremiumStickers" = "Premium Stickers"; + +"EmojiInput.PremiumEmojiToast.Text" = "Subscribe to Telegram Premium to unlock premium emoji."; +"EmojiInput.PremiumEmojiToast.Action" = "More"; diff --git a/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift b/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift index 1d78a0fb79..f24eedbc3a 100644 --- a/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift +++ b/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift @@ -568,8 +568,7 @@ private func installedStickerPacksControllerEntries(presentationData: Presentati } entries.append(.masks(presentationData.theme, presentationData.strings.MaskStickerSettings_Title)) - //TODO:localize - entries.append(.emoji(presentationData.theme, "Emoji")) + entries.append(.emoji(presentationData.theme, presentationData.strings.StickersList_EmojiItem)) entries.append(.quickReaction(presentationData.strings.Settings_QuickReactionSetup_NavigationTitle, quickReactionImage)) @@ -614,8 +613,7 @@ private func installedStickerPacksControllerEntries(presentationData: Presentati } case .emoji: if let archived = archived, !archived.isEmpty { - //TODO:localize - entries.append(.archived(presentationData.theme, "Archived Emoji", Int32(archived.count), archived)) + entries.append(.archived(presentationData.theme, presentationData.strings.StickersList_ArchivedEmojiItem, Int32(archived.count), archived)) } } diff --git a/submodules/TelegramStringFormatting/Sources/MessageContentKind.swift b/submodules/TelegramStringFormatting/Sources/MessageContentKind.swift index dcaf7fa6ce..74664be74d 100644 --- a/submodules/TelegramStringFormatting/Sources/MessageContentKind.swift +++ b/submodules/TelegramStringFormatting/Sources/MessageContentKind.swift @@ -300,8 +300,47 @@ public func foldLineBreaks(_ text: String) -> String { } public func foldLineBreaks(_ text: NSAttributedString) -> NSAttributedString { - //TODO:localize - return text + let remainingString = NSMutableAttributedString(attributedString: text) + var lines: [NSAttributedString] = [] + while true { + if let range = remainingString.string.range(of: "\n") { + let mappedRange = NSRange(range, in: remainingString.string) + lines.append(remainingString.attributedSubstring(from: NSRange(location: 0, length: mappedRange.upperBound))) + remainingString.replaceCharacters(in: NSRange(location: 0, length: mappedRange.upperBound), with: "") + } else { + if lines.isEmpty { + return text + } + if !remainingString.string.isEmpty { + lines.append(remainingString) + } + break + } + } + + let result = NSMutableAttributedString() + + for line in lines { + if line.string.isEmpty { + continue + } + if result.string.isEmpty { + result.append(line) + } else { + let currentAttributes = line.attributes(at: 0, effectiveRange: nil).filter { key, _ in + switch key { + case .font, .foregroundColor: + return true + default: + return false + } + } + result.append(NSAttributedString(string: " ", attributes: currentAttributes)) + result.append(line) + } + } + + return result } public func trimToLineCount(_ text: String, lineCount: Int) -> String { diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift index ca20687d7d..a9c2181733 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EmojiPagerContentComponent.swift @@ -2144,7 +2144,7 @@ public final class EmojiPagerContentComponent: Component { private var component: EmojiPagerContentComponent? private weak var state: EmptyComponentState? private var pagerEnvironment: PagerComponentChildEnvironment? - private var theme: PresentationTheme? + private var keyboardChildEnvironment: EntityKeyboardChildEnvironment? private var activeItemUpdated: ActionSlot<(AnyHashable, AnyHashable?, Transition)>? private var itemLayout: ItemLayout? @@ -3010,7 +3010,7 @@ public final class EmojiPagerContentComponent: Component { } private func updateVisibleItems(transition: Transition, attemptSynchronousLoads: Bool, previousItemPositions: [ItemLayer.Key: CGPoint]?, updatedItemPositions: [ItemLayer.Key: CGPoint]?) { - guard let component = self.component, let pagerEnvironment = self.pagerEnvironment, let theme = self.theme, let itemLayout = self.itemLayout else { + guard let component = self.component, let pagerEnvironment = self.pagerEnvironment, let keyboardChildEnvironment = self.keyboardChildEnvironment, let itemLayout = self.itemLayout else { return } @@ -3089,7 +3089,7 @@ public final class EmojiPagerContentComponent: Component { let (groupHeaderSize, centralContentWidth) = groupHeaderView.update( context: component.context, - theme: theme, + theme: keyboardChildEnvironment.theme, layoutType: itemLayout.layoutType, hasTopSeparator: hasTopSeparator, actionButtonTitle: actionButtonTitle, @@ -3130,7 +3130,7 @@ public final class EmojiPagerContentComponent: Component { self.scrollView.layer.insertSublayer(groupBorderLayer, at: 0) self.mirrorContentScrollView.layer.addSublayer(groupBorderLayer.tintContainerLayer) - groupBorderLayer.strokeColor = theme.chat.inputMediaPanel.panelContentVibrantOverlayColor.cgColor + groupBorderLayer.strokeColor = keyboardChildEnvironment.theme.chat.inputMediaPanel.panelContentVibrantOverlayColor.cgColor groupBorderLayer.tintContainerLayer.strokeColor = UIColor.white.cgColor groupBorderLayer.lineWidth = 1.6 groupBorderLayer.lineCap = .round @@ -3198,7 +3198,6 @@ public final class EmojiPagerContentComponent: Component { let groupId = itemGroup.groupId let isPremiumLocked = itemGroup.isPremiumLocked - //TODO:localize let title: String let backgroundColor: UIColor let backgroundColors: [UIColor] @@ -3206,7 +3205,7 @@ public final class EmojiPagerContentComponent: Component { let animationName: String? let gloss: Bool if itemGroup.isPremiumLocked { - title = "Unlock \(itemGroup.title ?? "Emoji")" + title = keyboardChildEnvironment.strings.EmojiInput_UnlockPack(itemGroup.title ?? "Emoji").string backgroundColors = [ UIColor(rgb: 0x0077ff), UIColor(rgb: 0x6b93ff), @@ -3218,10 +3217,10 @@ public final class EmojiPagerContentComponent: Component { animationName = "premium_unlock" gloss = true } else { - title = "Add \(itemGroup.title ?? "Emoji")" + title = keyboardChildEnvironment.strings.EmojiInput_AddPack(itemGroup.title ?? "Emoji").string backgroundColors = [] - backgroundColor = theme.list.itemCheckColors.fillColor - foregroundColor = theme.list.itemCheckColors.foregroundColor + backgroundColor = keyboardChildEnvironment.theme.list.itemCheckColors.fillColor + foregroundColor = keyboardChildEnvironment.theme.list.itemCheckColors.foregroundColor animationName = nil gloss = false } @@ -3291,7 +3290,7 @@ public final class EmojiPagerContentComponent: Component { } let baseItemFrame = itemLayout.frame(groupIndex: groupItems.groupIndex, itemIndex: collapsedItemIndex) - let buttonSize = groupExpandActionButton.update(theme: theme, title: collapsedItemText) + let buttonSize = groupExpandActionButton.update(theme: keyboardChildEnvironment.theme, title: collapsedItemText) let buttonFrame = CGRect(origin: CGPoint(x: baseItemFrame.minX + floor((baseItemFrame.width - buttonSize.width) / 2.0), y: baseItemFrame.minY + floor((baseItemFrame.height - buttonSize.height) / 2.0)), size: buttonSize) groupExpandActionButtonTransition.setFrame(view: groupExpandActionButton, frame: buttonFrame) } @@ -3338,8 +3337,8 @@ public final class EmojiPagerContentComponent: Component { staticEmoji: item.staticEmoji, cache: component.animationCache, renderer: component.animationRenderer, - placeholderColor: theme.chat.inputPanel.primaryTextColor.withMultipliedAlpha(0.1), - blurredBadgeColor: theme.chat.inputPanel.panelBackgroundColor.withMultipliedAlpha(0.5), + placeholderColor: keyboardChildEnvironment.theme.chat.inputPanel.primaryTextColor.withMultipliedAlpha(0.1), + blurredBadgeColor: keyboardChildEnvironment.theme.chat.inputPanel.panelBackgroundColor.withMultipliedAlpha(0.5), pointSize: item.staticEmoji == nil ? itemPlaybackSize : itemVisibleFitSize, onUpdateDisplayPlaceholder: { [weak self] displayPlaceholder, duration in guard let strongSelf = self else { @@ -3421,7 +3420,7 @@ public final class EmojiPagerContentComponent: Component { if itemGroup.displayPremiumBadges, let file = item.file, file.isPremiumSticker { badge = .premium } - itemLayer.update(transition: transition, size: itemFrame.size, badge: badge, blurredBadgeColor: UIColor(white: 0.0, alpha: 0.1), blurredBadgeBackgroundColor: theme.list.plainBackgroundColor) + itemLayer.update(transition: transition, size: itemFrame.size, badge: badge, blurredBadgeColor: UIColor(white: 0.0, alpha: 0.1), blurredBadgeBackgroundColor: keyboardChildEnvironment.theme.list.plainBackgroundColor) if let placeholderView = self.visibleItemPlaceholderViews[itemId] { if placeholderView.layer.position != itemPosition || placeholderView.layer.bounds != itemBounds { @@ -3566,7 +3565,7 @@ public final class EmojiPagerContentComponent: Component { } public func pagerUpdateBackground(backgroundFrame: CGRect, transition: Transition) { - guard let theme = self.theme else { + guard let keyboardChildEnvironment = self.keyboardChildEnvironment else { return } @@ -3584,7 +3583,7 @@ public final class EmojiPagerContentComponent: Component { vibrancyEffectView.contentView.addSubview(self.mirrorContentScrollView) } - self.backgroundView.updateColor(color: theme.chat.inputMediaPanel.backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition) + self.backgroundView.updateColor(color: keyboardChildEnvironment.theme.chat.inputMediaPanel.backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition) transition.setFrame(view: self.backgroundView, frame: backgroundFrame) self.backgroundView.update(size: backgroundFrame.size, transition: transition.containedViewLayoutTransition) @@ -3604,7 +3603,7 @@ public final class EmojiPagerContentComponent: Component { let keyboardChildEnvironment = environment[EntityKeyboardChildEnvironment.self].value let pagerEnvironment = environment[PagerComponentChildEnvironment.self].value - self.theme = keyboardChildEnvironment.theme + self.keyboardChildEnvironment = keyboardChildEnvironment self.activeItemUpdated = keyboardChildEnvironment.getContentActiveItemUpdated(component.id) self.pagerEnvironment = pagerEnvironment diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift index 738ed544e1..b3423d2bbc 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboard.swift @@ -13,13 +13,16 @@ import SwiftSignalKit public final class EntityKeyboardChildEnvironment: Equatable { public let theme: PresentationTheme + public let strings: PresentationStrings public let getContentActiveItemUpdated: (AnyHashable) -> ActionSlot<(AnyHashable, AnyHashable?, Transition)>? public init( theme: PresentationTheme, + strings: PresentationStrings, getContentActiveItemUpdated: @escaping (AnyHashable) -> ActionSlot<(AnyHashable, AnyHashable?, Transition)>? ) { self.theme = theme + self.strings = strings self.getContentActiveItemUpdated = getContentActiveItemUpdated } @@ -27,6 +30,9 @@ public final class EntityKeyboardChildEnvironment: Equatable { if lhs.theme !== rhs.theme { return false } + if lhs.strings !== rhs.strings { + return false + } return true } @@ -74,6 +80,7 @@ public final class EntityKeyboardComponent: Component { } public let theme: PresentationTheme + public let strings: PresentationStrings public let containerInsets: UIEdgeInsets public let emojiContent: EmojiPagerContentComponent public let stickerContent: EmojiPagerContentComponent? @@ -93,6 +100,7 @@ public final class EntityKeyboardComponent: Component { public init( theme: PresentationTheme, + strings: PresentationStrings, containerInsets: UIEdgeInsets, emojiContent: EmojiPagerContentComponent, stickerContent: EmojiPagerContentComponent?, @@ -111,6 +119,7 @@ public final class EntityKeyboardComponent: Component { isExpanded: Bool ) { self.theme = theme + self.strings = strings self.containerInsets = containerInsets self.emojiContent = emojiContent self.stickerContent = stickerContent @@ -133,6 +142,9 @@ public final class EntityKeyboardComponent: Component { if lhs.theme !== rhs.theme { return false } + if lhs.strings !== rhs.strings { + return false + } if lhs.containerInsets != rhs.containerInsets { return false } @@ -227,7 +239,6 @@ public final class EntityKeyboardComponent: Component { if let gifContent = component.gifContent { contents.append(AnyComponentWithIdentity(id: "gifs", component: AnyComponent(gifContent))) var topGifItems: [EntityKeyboardTopPanelComponent.Item] = [] - //TODO:localize if component.hasRecentGifs { topGifItems.append(EntityKeyboardTopPanelComponent.Item( id: "recent", @@ -235,7 +246,7 @@ public final class EntityKeyboardComponent: Component { content: AnyComponent(EntityKeyboardIconTopPanelComponent( icon: .recent, theme: component.theme, - title: "Recent", + title: component.strings.Stickers_Recent, pressed: { [weak self] in self?.component?.switchToGifSubject(.recent) } @@ -248,7 +259,7 @@ public final class EntityKeyboardComponent: Component { content: AnyComponent(EntityKeyboardIconTopPanelComponent( icon: .trending, theme: component.theme, - title: "Trending", + title: component.strings.Stickers_Trending, pressed: { [weak self] in self?.component?.switchToGifSubject(.trending) } @@ -307,14 +318,13 @@ public final class EntityKeyboardComponent: Component { if let stickerContent = component.stickerContent { var topStickerItems: [EntityKeyboardTopPanelComponent.Item] = [] - //TODO:localize topStickerItems.append(EntityKeyboardTopPanelComponent.Item( id: "featuredTop", isReorderable: false, content: AnyComponent(EntityKeyboardIconTopPanelComponent( icon: .featured, theme: component.theme, - title: "Featured", + title: component.strings.Stickers_Trending, pressed: { [weak self] in self?.component?.stickerContent?.inputInteractionHolder.inputInteraction?.openFeatured() } @@ -328,11 +338,10 @@ public final class EntityKeyboardComponent: Component { "recent": .recent, "premium": .premium ] - //TODO:localize let titleMapping: [String: String] = [ - "saved": "Saved", - "recent": "Recent", - "premium": "Premium" + "saved": component.strings.Stickers_Favorites, + "recent": component.strings.Stickers_Recent, + "premium": component.strings.EmojiInput_PanelTitlePremium ] if let icon = iconMapping[id], let title = titleMapping[id] { topStickerItems.append(EntityKeyboardTopPanelComponent.Item( @@ -419,9 +428,8 @@ public final class EntityKeyboardComponent: Component { let iconMapping: [String: EntityKeyboardIconTopPanelComponent.Icon] = [ "recent": .recent, ] - //TODO:localize let titleMapping: [String: String] = [ - "recent": "Recent", + "recent": component.strings.Stickers_Recent, ] if let icon = iconMapping[id], let title = titleMapping[id] { topEmojiItems.append(EntityKeyboardTopPanelComponent.Item( @@ -438,13 +446,12 @@ public final class EntityKeyboardComponent: Component { )) } } else if id == "static" { - //TODO:localize topEmojiItems.append(EntityKeyboardTopPanelComponent.Item( id: itemGroup.supergroupId, isReorderable: false, content: AnyComponent(EntityKeyboardStaticStickersPanelComponent( theme: component.theme, - title: "Emoji", + title: component.strings.EmojiInput_PanelTitleEmoji, pressed: { [weak self] subgroupId in guard let strongSelf = self else { return @@ -538,10 +545,7 @@ public final class EntityKeyboardComponent: Component { contentAccessoryLeftButtons: contentAccessoryLeftButtons, contentAccessoryRightButtons: contentAccessoryRightButtons, defaultId: component.defaultToEmojiTab ? "emoji" : "stickers", - contentBackground: nil/*AnyComponent(BlurredBackgroundComponent( - color: component.theme.chat.inputMediaPanel.stickersBackgroundColor.withMultipliedAlpha(0.75), - tintContainerView: self.tintContainerView - ))*/, + contentBackground: nil, topPanel: AnyComponent(EntityKeyboardTopContainerPanelComponent( theme: component.theme, overflowHeight: component.hiddenInputHeight, @@ -573,6 +577,7 @@ public final class EntityKeyboardComponent: Component { environment: { EntityKeyboardChildEnvironment( theme: component.theme, + strings: component.strings, getContentActiveItemUpdated: { id in if id == AnyHashable("gifs") { return gifsContentItemIdUpdated diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 4a09a6553a..4c3b18a57b 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -7123,9 +7123,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G }) if let firstLockedPremiumEmoji = firstLockedPremiumEmoji { - //let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } - //TODO:localize - strongSelf.controllerInteraction?.displayUndo(.sticker(context: strongSelf.context, file: firstLockedPremiumEmoji, title: nil, text: "Subscribe to Telegram Premium to unlock premium emoji.", undoText: "More", customAction: { + let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 } + strongSelf.controllerInteraction?.displayUndo(.sticker(context: strongSelf.context, file: firstLockedPremiumEmoji, title: nil, text: presentationData.strings.EmojiInput_PremiumEmojiToast_Text, undoText: presentationData.strings.EmojiInput_PremiumEmojiToast_Action, customAction: { guard let strongSelf = self else { return } diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index 3534b73875..09fd9c55ea 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -2895,9 +2895,8 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate { }) if let firstLockedPremiumEmoji = firstLockedPremiumEmoji { - //let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } - //TODO:localize - self.controllerInteraction.displayUndo(.sticker(context: context, file: firstLockedPremiumEmoji, title: nil, text: "Subscribe to Telegram Premium to unlock premium emoji.", undoText: "More", customAction: { [weak self] in + let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } + self.controllerInteraction.displayUndo(.sticker(context: context, file: firstLockedPremiumEmoji, title: nil, text: presentationData.strings.EmojiInput_PremiumEmojiToast_Text, undoText: presentationData.strings.EmojiInput_PremiumEmojiToast_Action, customAction: { [weak self] in guard let strongSelf = self else { return } diff --git a/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift b/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift index ead582706d..9f068eee88 100644 --- a/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift +++ b/submodules/TelegramUI/Sources/ChatEntityKeyboardInputNode.swift @@ -99,6 +99,8 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 }) let isPremiumDisabled = premiumConfiguration.isPremiumDisabled + let strings = context.sharedContext.currentPresentationData.with({ $0 }).strings + let emojiItems: Signal = combineLatest( context.account.postbox.itemCollectionsView(orderedItemListCollectionIds: [Namespaces.OrderedItemList.LocalRecentEmoji], namespaces: [Namespaces.ItemCollection.CloudEmojiPacks], aroundIndex: nil, count: 10000000), hasPremium, @@ -160,8 +162,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { itemGroups[groupIndex].items.append(resultItem) } else { itemGroupIndexById[groupId] = itemGroups.count - //TODO:localize - itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: "Recently Used", subtitle: nil, isPremiumLocked: false, isFeatured: false, isExpandable: false, items: [resultItem])) + itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: strings.Stickers_FrequentlyUsed, subtitle: nil, isPremiumLocked: false, isFeatured: false, isExpandable: false, items: [resultItem])) } } } @@ -179,8 +180,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { itemGroups[groupIndex].items.append(resultItem) } else { itemGroupIndexById[groupId] = itemGroups.count - //TODO:localize - itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: "Emoji", subtitle: nil, isPremiumLocked: false, isFeatured: false, isExpandable: false, items: [resultItem])) + itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: strings.EmojiInput_SectionTitleEmoji, subtitle: nil, isPremiumLocked: false, isFeatured: false, isExpandable: false, items: [resultItem])) } } } @@ -418,8 +418,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { itemGroups[groupIndex].items.append(resultItem) } else { itemGroupIndexById[groupId] = itemGroups.count - //TODO:localize - itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: "Saved", subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, items: [resultItem])) + itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: strings.EmojiInput_SectionTitleFavoriteStickers, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, items: [resultItem])) } } } @@ -444,8 +443,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { itemGroups[groupIndex].items.append(resultItem) } else { itemGroupIndexById[groupId] = itemGroups.count - //TODO:localize - itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: "Recently Used", subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, items: [resultItem])) + itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: strings.Stickers_FrequentlyUsed, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, items: [resultItem])) } } } @@ -489,8 +487,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { itemGroups[groupIndex].items.append(resultItem) } else { itemGroupIndexById[groupId] = itemGroups.count - //TODO:localize - itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: "Premium", subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, items: [resultItem])) + itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: strings.EmojiInput_SectionTitlePremiumStickers, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, items: [resultItem])) } } } @@ -1014,11 +1011,9 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { strongSelf.currentUndoOverlayController = nil animateInAsReplacement = true } - - //TODO:localize let presentationData = context.sharedContext.currentPresentationData.with { $0 } - let controller = UndoOverlayController(presentationData: presentationData, content: .sticker(context: context, file: file, title: nil, text: "Subscribe to Telegram Premium to unlock this emoji.", undoText: "More", customAction: { [weak controllerInteraction] in + let controller = UndoOverlayController(presentationData: presentationData, content: .sticker(context: context, file: file, title: nil, text: presentationData.strings.EmojiInput_PremiumEmojiToast_Text, undoText: presentationData.strings.EmojiInput_PremiumEmojiToast_Action, customAction: { [weak controllerInteraction] in guard let controllerInteraction = controllerInteraction else { return } @@ -1545,6 +1540,7 @@ final class ChatEntityKeyboardInputNode: ChatInputNode { transition: mappedTransition, component: AnyComponent(EntityKeyboardComponent( theme: interfaceState.theme, + strings: interfaceState.strings, containerInsets: UIEdgeInsets(top: 0.0, left: leftInset, bottom: bottomInset, right: rightInset), emojiContent: self.currentInputData.emoji, stickerContent: stickerContent, @@ -1993,10 +1989,8 @@ final class EntityInputView: UIView, AttachmentTextInputPanelInputView, UIInputV } if file.isPremiumEmoji && !hasPremium { - //TODO:localize - let presentationData = context.sharedContext.currentPresentationData.with { $0 } - strongSelf.presentController?(UndoOverlayController(presentationData: presentationData, content: .sticker(context: context, file: file, title: nil, text: "Subscribe to Telegram Premium to unlock this emoji.", undoText: "More", customAction: { + strongSelf.presentController?(UndoOverlayController(presentationData: presentationData, content: .sticker(context: context, file: file, title: nil, text: presentationData.strings.EmojiInput_PremiumEmojiToast_Text, undoText: presentationData.strings.EmojiInput_PremiumEmojiToast_Action, customAction: { guard let strongSelf = self else { return }