diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index f1666c614f..aaa0b1c611 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -16041,3 +16041,55 @@ Error: %8$@"; "CreatePoll.Deadline.Title" = "Deadline"; "CreatePoll.Deadline.SetDeadline" = "Set Deadline"; + +"Attachment.File.PollSubtitle.Description" = "Add file to the poll description"; +"Attachment.File.PollSubtitle.Explanation" = "Add file to the quiz explanation"; + +"Location.PollSubtitle.Description" = "Add location to the poll description"; +"Location.PollSubtitle.Explanation" = "Add location to the quiz explanation"; +"Location.PollSubtitle.PollOption" = "Add location to this option"; + +"MediaPicker.PollSubtitle.Description" = "Add media to the poll description"; +"MediaPicker.PollSubtitle.Explanation" = "Add media to the quiz explanation"; +"MediaPicker.PollSubtitle.PollOption" = "Add media to this option"; + +"StickerPicker.Title" = "Sticker"; +"StickerPicker.PollSubtitle.PollOption" = "Add media to this option"; + +"Chat.Poll.HiddenResultsTooltip" = "Results will appear after the poll ends"; + +"CreatePoll.DescriptionPlaceholder" = "Add Description (optional)"; +"CreatePoll.OptionsTitle" = "OPTIONS"; + +"CreatePoll.SettingsTitle" = "SETTINGS"; +"CreatePoll.ShowWhoVoted" = "Show Who Voted"; +"CreatePoll.ShowWhoVotedInfo" = "Display voter names on each option"; +"CreatePoll.MultiAnswer" = "Allow Multiple Answers"; +"CreatePoll.MultiAnswerInfo" = "Voters can select more than one option"; +"CreatePoll.AddingOptions" = "Allow Adding Options"; +"CreatePoll.AddingOptionsInfo" = "Participants can suggest new options"; +"CreatePoll.Revoting" = "Allow Revoting"; +"CreatePoll.RevotingInfo" = "Voters can change their vote"; +"CreatePoll.ShuffleOptions" = "Shuffle Options"; +"CreatePoll.ShuffleOptionsInfo" = "Answers appear in random order for each voter"; +"CreatePoll.EnableQuiz" = "Set Correct Answer"; +"CreatePoll.EnableQuizInfo" = "Mark one option as the right answer"; +"CreatePoll.EnableQuizMultiInfo" = "Mark one or more options as the right answer"; +"CreatePoll.LimitDuration" = "Limit Duration"; +"CreatePoll.LimitDurationInfo" = "Automatically close the poll at set time"; +"CreatePoll.LimitDuration.Duration" = "Duration"; +"CreatePoll.LimitDuration.PollEnds" = "Poll Ends"; +"CreatePoll.LimitDuration.HideResults" = "Hide Results"; +"CreatePoll.LimitDuration.HideResultsInfo" = "If you switch this on, results will be visible only after the poll closes."; +"CreatePoll.MediaUploading.Title" = "Please Wait"; +"CreatePoll.MediaUploading.Text" = "Poll media is still uploading..."; +"CreatePoll.DiscardPoll" = "Discard Poll?"; + +"CreatePoll.Media.Replace" = "Replace"; +"CreatePoll.Media.Delete" = "Delete"; +"CreatePoll.TimeLimit.Custom" = "Custom"; + +"MediaPicker.LivePhoto.Live" = "Live"; +"MediaPicker.LivePhoto.Loop" = "Loop"; +"MediaPicker.LivePhoto.Bounce" = "Bounce"; +"MediaPicker.LivePhoto.LiveOff" = "Live Off"; diff --git a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift index 8e8f4496a5..b9a825cc98 100644 --- a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift +++ b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift @@ -1369,14 +1369,13 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM if let source = self.controller?.source { switch source { case let .poll(pollMode): - //TODO:localize switch pollMode { case .description: - subtitle = "Add location to the poll description" + subtitle = self.presentationData.strings.Location_PollSubtitle_Description case .quizAnswer: - subtitle = "Add location to the quiz explanation" + subtitle = self.presentationData.strings.Location_PollSubtitle_Explanation case .option: - subtitle = "Add location to this option" + subtitle = self.presentationData.strings.Location_PollSubtitle_PollOption } default: break diff --git a/submodules/MediaPickerUI/Sources/LegacyMediaPickerGallery.swift b/submodules/MediaPickerUI/Sources/LegacyMediaPickerGallery.swift index fc256f60f9..01ecb788f3 100644 --- a/submodules/MediaPickerUI/Sources/LegacyMediaPickerGallery.swift +++ b/submodules/MediaPickerUI/Sources/LegacyMediaPickerGallery.swift @@ -162,9 +162,8 @@ func presentLegacyMediaPickerGallery( } else if peer == nil { return nil } - let livePhotoButton = LivePhotoButton() + let livePhotoButton = LivePhotoButton(context: context) livePhotoButton.present = present - livePhotoButton.context = context return livePhotoButton } paintStickersContext.editCover = { dimensions, completion in diff --git a/submodules/MediaPickerUI/Sources/LivePhotoButton.swift b/submodules/MediaPickerUI/Sources/LivePhotoButton.swift index 3cce5fd9e7..21d048fa85 100644 --- a/submodules/MediaPickerUI/Sources/LivePhotoButton.swift +++ b/submodules/MediaPickerUI/Sources/LivePhotoButton.swift @@ -20,7 +20,7 @@ final class LivePhotoButton: UIView, TGLivePhotoButton { public var modeUpdated: ((TGMediaLivePhotoMode) -> Void)? - var context: AccountContext? + let context: AccountContext var present: ((ViewController, Any?) -> Void)? var view: UIView { @@ -31,10 +31,12 @@ final class LivePhotoButton: UIView, TGLivePhotoButton { return self.bounds.insetBy(dx: -16.0, dy: -16.0).contains(point) } - override init(frame: CGRect) { + init(context: AccountContext) { + self.context = context + self.backgroundView = GlassContextExtractableContainer() - super.init(frame: frame) + super.init(frame: .zero) self.addSubview(self.backgroundView) self.backgroundView.contentView.addSubview(self.button) @@ -49,29 +51,25 @@ final class LivePhotoButton: UIView, TGLivePhotoButton { } @objc private func buttonPressed() { - guard let context = self.context else { - return - } - - let presentationData = context.sharedContext.currentPresentationData.with { $0 }.withUpdated(theme: defaultDarkPresentationTheme) + let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }.withUpdated(theme: defaultDarkPresentationTheme) var items: [ContextMenuItem] = [] - items.append(.action(ContextMenuActionItem(text: "Live", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveOn"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.MediaPicker_LivePhoto_Live, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveOn"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in self?.modeUpdated?(.live) f(.default) }))) - items.append(.action(ContextMenuActionItem(text: "Loop", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveLoop"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.MediaPicker_LivePhoto_Loop, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveLoop"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in self?.modeUpdated?(.loop) f(.default) }))) - items.append(.action(ContextMenuActionItem(text: "Bounce", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveBounce"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.MediaPicker_LivePhoto_Bounce, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveBounce"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in self?.modeUpdated?(.bounce) f(.default) }))) - items.append(.action(ContextMenuActionItem(text: "Live Off", icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveOff"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.MediaPicker_LivePhoto_LiveOff, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Media Editor/LiveOff"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in self?.modeUpdated?(.off) f(.default) @@ -97,20 +95,22 @@ final class LivePhotoButton: UIView, TGLivePhotoButton { } func update() { + let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } + let iconName: String let labelText: String switch self.mode { case .live: - labelText = "Live" + labelText = presentationData.strings.MediaPicker_LivePhoto_Live iconName = "Media Editor/LiveOn" case .loop: - labelText = "Loop" + labelText = presentationData.strings.MediaPicker_LivePhoto_Loop iconName = "Media Editor/LiveLoop" case .bounce: - labelText = "Bounce" + labelText = presentationData.strings.MediaPicker_LivePhoto_Bounce iconName = "Media Editor/LiveBounce" default: - labelText = "Live Off" + labelText = presentationData.strings.MediaPicker_LivePhoto_LiveOff iconName = "Media Editor/LiveOff" } diff --git a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift index c3d4c09c01..8097ef956a 100644 --- a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift +++ b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift @@ -2085,14 +2085,13 @@ public final class MediaPickerScreenImpl: ViewController, MediaPickerScreen, Att self.titleView.title = presentationData.strings.MediaPicker_ChooseCover case let .poll(pollMode, _): self.titleView.title = presentationData.strings.MediaPicker_Recents - //TODO:localize switch pollMode { case .description: - self.titleView.subtitle = "Add media to the poll description" + self.titleView.subtitle = presentationData.strings.MediaPicker_PollSubtitle_Description case .quizAnswer: - self.titleView.subtitle = "Add media to the quiz explanation" + self.titleView.subtitle = presentationData.strings.MediaPicker_PollSubtitle_Explanation case .option: - self.titleView.subtitle = "Add media to this option" + self.titleView.subtitle = presentationData.strings.MediaPicker_PollSubtitle_PollOption } self.titleView.isEnabled = true } diff --git a/submodules/TelegramUI/Components/AttachmentFileController/Sources/AttachmentFileController.swift b/submodules/TelegramUI/Components/AttachmentFileController/Sources/AttachmentFileController.swift index e88ed9a950..54020f8041 100644 --- a/submodules/TelegramUI/Components/AttachmentFileController/Sources/AttachmentFileController.swift +++ b/submodules/TelegramUI/Components/AttachmentFileController/Sources/AttachmentFileController.swift @@ -892,12 +892,11 @@ public func makeAttachmentFileControllerImpl( } if case let .poll(pollMode) = source { - //TODO:localize switch pollMode { case .description: - subtitle = "Add file to the poll description" + subtitle = presentationData.strings.Attachment_File_PollSubtitle_Description case .quizAnswer: - subtitle = "Add file to the quiz explanation" + subtitle = presentationData.strings.Attachment_File_PollSubtitle_Explanation } } diff --git a/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift b/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift index 715334b8d9..999a785075 100644 --- a/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift +++ b/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift @@ -1029,8 +1029,7 @@ final class ComposePollScreenComponent: Component { if let file = media.media.media as? TelegramMediaFile, file.isSticker || file.isCustomEmoji { var items: [ContextMenuItem] = [] - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Replace", icon: { theme in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.CreatePoll_Media_Replace, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Replace"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in f(.default) @@ -1040,7 +1039,7 @@ final class ComposePollScreenComponent: Component { self.openAttachedMedia(subject: subject, replace: true) }))) - items.append(.action(ContextMenuActionItem(text: "Delete", textColor: .destructive, icon: { theme in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.CreatePoll_Media_Delete, textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak self] _, f in f(.default) @@ -1071,8 +1070,7 @@ final class ComposePollScreenComponent: Component { } else { var items: [ContextMenuItem] = [] - //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Replace", icon: { theme in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.CreatePoll_Media_Replace, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Replace"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in f(.default) @@ -1082,7 +1080,7 @@ final class ComposePollScreenComponent: Component { self.openAttachedMedia(subject: subject, replace: true) }))) - items.append(.action(ContextMenuActionItem(text: "Delete", textColor: .destructive, icon: { theme in + items.append(.action(ContextMenuActionItem(text: presentationData.strings.CreatePoll_Media_Delete, textColor: .destructive, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Delete"), color: theme.contextMenu.destructiveColor) }, action: { [weak self] _, f in f(.default) @@ -1162,8 +1160,7 @@ final class ComposePollScreenComponent: Component { }))) } - //TODO:localize - subItems.append(.action(ContextMenuActionItem(text: "Custom", icon: { theme in + subItems.append(.action(ContextMenuActionItem(text: presentationData.strings.CreatePoll_TimeLimit_Custom, icon: { theme in return nil }, action: { [weak self] _, f in f(.default) @@ -1448,18 +1445,7 @@ final class ComposePollScreenComponent: Component { assumeIsEditing: self.inputMediaNodeTargetTag === self.pollTextFieldTag, characterLimit: component.initialData.maxPollTextLength, emptyLineHandling: .allowed, - returnKeyAction: { [weak self] in - guard let self else { - return - } - let _ = self -// if !self.pollOptions.isEmpty { -// if let pollOptionView = self.pollOptionsSectionContainer.itemViews[self.pollOptions[0].id] { -// if let pollOptionComponentView = pollOptionView.contents.view as? ListComposePollOptionComponent.View { -// pollOptionComponentView.activateInput() -// } -// } -// } + returnKeyAction: { }, backspaceKeyAction: nil, selection: nil, @@ -1483,7 +1469,6 @@ final class ComposePollScreenComponent: Component { var pollDescriptionAttachment: ListComposePollOptionComponent.Attachment pollDescriptionAttachment = .init(media: self.pollDescriptionMedia?.media, progress: self.pollDescriptionMedia?.progress, alwaysDisplayAttachButton: true) - //TODO:localize pollTextSectionItems.append(AnyComponentWithIdentity(id: 1, component: AnyComponent(ListComposePollOptionComponent( externalState: self.pollDescriptionInputState, context: component.context, @@ -1547,9 +1532,8 @@ final class ComposePollScreenComponent: Component { if let itemView = pollTextSectionView.itemView(id: 0) as? ListComposePollOptionComponent.View { itemView.updateCustomPlaceholder(value: environment.strings.CreatePoll_TextPlaceholder, size: itemView.bounds.size, transition: .immediate) } - //TODO:localize if let itemView = pollTextSectionView.itemView(id: 1) as? ListComposePollOptionComponent.View { - itemView.updateCustomPlaceholder(value: "Add Description (optional)", size: itemView.bounds.size, transition: .immediate) + itemView.updateCustomPlaceholder(value: environment.strings.CreatePoll_DescriptionPlaceholder, size: itemView.bounds.size, transition: .immediate) } } contentHeight += pollTextSectionSize.height @@ -1763,13 +1747,12 @@ final class ComposePollScreenComponent: Component { transition: transition ) - //TODO:localize let sectionHeaderSideInset: CGFloat = 16.0 let pollOptionsSectionHeaderSize = self.pollOptionsSectionHeader.update( transition: .immediate, component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "OPTIONS", + string: environment.strings.CreatePoll_OptionsTitle, font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: theme.list.freeTextColor )), @@ -1890,7 +1873,6 @@ final class ComposePollScreenComponent: Component { contentHeight += pollOptionsSectionFooterSize.height contentHeight += sectionSpacing - //TODO:localize var pollSettingsSectionItems: [AnyComponentWithIdentity] = [] if !isChannel { pollSettingsSectionItems.append(AnyComponentWithIdentity(id: "anonymous", component: AnyComponent(ListActionItemComponent( @@ -1899,7 +1881,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Show Who Voted", + string: environment.strings.CreatePoll_ShowWhoVoted, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -1907,7 +1889,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Display voter names on each option", + string: environment.strings.CreatePoll_ShowWhoVotedInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -1938,7 +1920,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Allow Multiple Answers", + string: environment.strings.CreatePoll_MultiAnswer, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -1946,7 +1928,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Voters can select more than one option", + string: environment.strings.CreatePoll_MultiAnswerInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -1986,7 +1968,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Allow Adding Options", + string: environment.strings.CreatePoll_AddingOptions, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -1994,7 +1976,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Participants can suggest new options", + string: environment.strings.CreatePoll_AddingOptionsInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -2026,7 +2008,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Allow Revoting", + string: environment.strings.CreatePoll_Revoting, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -2034,7 +2016,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Voters can change their vote", + string: environment.strings.CreatePoll_RevotingInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -2062,7 +2044,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Shuffle Options", + string: environment.strings.CreatePoll_ShuffleOptions, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -2070,7 +2052,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Answers appear in random order for each voter", + string: environment.strings.CreatePoll_ShuffleOptionsInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -2098,7 +2080,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Set Correct Answer", + string: environment.strings.CreatePoll_EnableQuiz, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -2106,7 +2088,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: self.effectiveIsMultiAnswer ? "Mark one or more options as the right answer" : "Mark one option as the right answer", + string: self.effectiveIsMultiAnswer ? environment.strings.CreatePoll_EnableQuizMultiInfo : environment.strings.CreatePoll_EnableQuizInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -2140,7 +2122,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Limit Duration", + string: environment.strings.CreatePoll_LimitDuration, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -2148,7 +2130,7 @@ final class ComposePollScreenComponent: Component { ))), AnyComponentWithIdentity(id: AnyHashable(1), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Automatically close the poll at set time", + string: environment.strings.CreatePoll_LimitDurationInfo, font: Font.regular(presentationData.listsFontSize.baseDisplaySize * 13.0 / 17.0), textColor: theme.list.itemSecondaryTextColor )), @@ -2181,10 +2163,10 @@ final class ComposePollScreenComponent: Component { switch self.timeLimit { case let .duration(duration): - title = "Duration" + title = environment.strings.CreatePoll_LimitDuration_Duration value = timeIntervalString(strings: environment.strings, value: duration) case let .deadline(deadline): - title = "Poll Ends" + title = environment.strings.CreatePoll_LimitDuration_PollEnds value = stringForMediumCompactDate(timestamp: deadline, strings: environment.strings, dateTimeFormat: environment.dateTimeFormat, withTime: true) } @@ -2228,7 +2210,7 @@ final class ComposePollScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Hide Results", + string: environment.strings.CreatePoll_LimitDuration_HideResults, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: theme.list.itemPrimaryTextColor )), @@ -2251,7 +2233,7 @@ final class ComposePollScreenComponent: Component { pollSettingsFooter = AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "If you switch this on, results will be visible only after the poll closes.", + string: environment.strings.CreatePoll_LimitDuration_HideResultsInfo, font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: theme.list.freeTextColor )), @@ -2259,7 +2241,6 @@ final class ComposePollScreenComponent: Component { )) } - //TODO:localize let pollSettingsSectionSize = self.pollSettingsSection.update( transition: transition, component: AnyComponent(ListSectionComponent( @@ -2267,7 +2248,7 @@ final class ComposePollScreenComponent: Component { style: .glass, header: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "SETTINGS", + string: environment.strings.CreatePoll_SettingsTitle, font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: theme.list.freeTextColor )), @@ -2899,11 +2880,10 @@ public class ComposePollScreen: ViewControllerComponentContainer, AttachmentCont self.completion(poll) self.dismiss() } else if case .isUploading = validatedInput { - //TODO:localize let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } let controller = UndoOverlayController( presentationData: presentationData, - content: .info(title: "Please wait", text: "Poll media is still uploading...", timeout: nil, customUndoText: nil), + content: .info(title: presentationData.strings.CreatePoll_MediaUploading_Title, text: presentationData.strings.CreatePoll_MediaUploading_Text, timeout: nil, customUndoText: nil), position: .top, action: { _ in return false @@ -2932,9 +2912,7 @@ public class ComposePollScreen: ViewControllerComponentContainer, AttachmentCont } let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } if componentView.hasAnyData { - //TODO:localize - let text = "Discard poll?" - let controller = textAlertController(context: self.context, title: nil, text: text, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Attachment_CancelSelectionAlertNo, action: { + let controller = textAlertController(context: self.context, title: nil, text: presentationData.strings.CreatePoll_DiscardPoll, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Attachment_CancelSelectionAlertNo, action: { }), TextAlertAction(type: .defaultAction, title: presentationData.strings.Attachment_CancelSelectionAlertYes, action: { completion() })]) diff --git a/submodules/TelegramUI/Components/ComposePollScreen/Sources/StickerAttachmentScreen.swift b/submodules/TelegramUI/Components/ComposePollScreen/Sources/StickerAttachmentScreen.swift index 7eaf342447..65fcfc9330 100644 --- a/submodules/TelegramUI/Components/ComposePollScreen/Sources/StickerAttachmentScreen.swift +++ b/submodules/TelegramUI/Components/ComposePollScreen/Sources/StickerAttachmentScreen.swift @@ -1186,27 +1186,26 @@ final class StickerAttachmentScreen: ViewControllerComponentContainer, Attachmen let presentationData = context.sharedContext.currentPresentationData.with { $0 } switch source { case let .poll(pollMode): - //TODO:localize let title: String let subtitle: String switch mode { case .stickers: - title = "Sticker" + title = presentationData.strings.StickerPicker_Title switch pollMode { case .description: - subtitle = "Add sticker to the poll description" + subtitle = "" case .quizAnswer: - subtitle = "Add sticker to the quiz explanation" + subtitle = "" case .option: - subtitle = "Add sticker to this option" + subtitle = presentationData.strings.StickerPicker_PollSubtitle_PollOption } case .emoji: title = "Emoji" switch pollMode { case .description: - subtitle = "Add emoji to the poll description" + subtitle = "" case .quizAnswer: - subtitle = "Add emoji to the quiz explanation" + subtitle = "" case .option: subtitle = "Add emoji to this option" } diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 3af4620ada..53f864031e 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -3742,10 +3742,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } if shouldDisplayHiddenResultsTooltip { - //TODO:localize let controller = UndoOverlayController( presentationData: strongSelf.presentationData, - content: .universal(animation: "anim_timer", scale: 0.06, colors: [:], title: nil, text: "Results will appear after the poll ends", customUndoText: nil, timeout: nil), + content: .universal(animation: "anim_timer", scale: 0.06, colors: [:], title: nil, text: strongSelf.presentationData.strings.Chat_Poll_HiddenResultsTooltip, customUndoText: nil, timeout: nil), action: { _ in return true } ) strongSelf.present(controller, in: .current)