Skip to content

Commit 92ef9a9

Browse files
author
Isaac
committed
Merge commit 'f14ee93d860698594f9b9fa177eefc3822c8a914'
2 parents 3371078 + f14ee93 commit 92ef9a9

File tree

11 files changed

+45
-46
lines changed

11 files changed

+45
-46
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13201,3 +13201,20 @@ Sorry for the inconvenience.";
1320113201
"Chat.ScheduledForceSendProcessingVideo.Title" = "Wait!";
1320213202
"Chat.ScheduledForceSendProcessingVideo.Text" = "This video hasn't been converted and optimized yet. If you send it now, the viewers of the video may experience slow download speed.";
1320313203
"Chat.ScheduledForceSendProcessingVideo.Action" = "Send Anyway";
13204+
13205+
"Chat.HashtagSuggestion.UseGeneric.Title" = "Use %@";
13206+
"Chat.HashtagSuggestion.UseGeneric.Text" = "searches posts from all channels";
13207+
13208+
"Chat.HashtagSuggestion.UseLocal.Title" = "Use %@";
13209+
"Chat.HashtagSuggestion.UseLocal.Channel.Text" = "searches only posts from this channel";
13210+
"Chat.HashtagSuggestion.UseLocal.Group.Text" = "searches only posts from this group";
13211+
13212+
"Gift.Convert.Period.Text" = "Do you want to convert this gift from **%1$@** to **%2$@**?\n\nConversion is available for the next %3$@.\n\nThis will permanently destroy the gift.";
13213+
"Gift.Convert.Period.Stars_1" = "%@ Star";
13214+
"Gift.Convert.Period.Stars_any" = "%@ Stars";
13215+
"Gift.Convert.Period.Days_1" = "%@ day";
13216+
"Gift.Convert.Period.Days_any" = "%@ days";
13217+
13218+
"Gift.Convert.Period.Unavailable.Text" = "Sorry, you can't convert this gift.\n\nStars can only be claimed within %@ after receiving a gift.";
13219+
"Gift.Convert.Period.Unavailable.Days_1" = "%@ day";
13220+
"Gift.Convert.Period.Unavailable.Days_any" = "%@ days";

submodules/TelegramUI/Components/Chat/ChatInputContextPanelNode/Sources/ChatInputContextPanelNode.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ open class ChatInputContextPanelNode: ASDisplayNode {
1919
open var interfaceInteraction: ChatPanelInterfaceInteraction?
2020
open var placement: ChatInputContextPanelPlacement = .overPanels
2121
open var theme: PresentationTheme
22+
open var strings: PresentationStrings
2223
open var fontSize: PresentationFontSize
2324

2425
public init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, fontSize: PresentationFontSize, chatPresentationContext: ChatPresentationContext) {
2526
self.context = context
2627
self.theme = theme
28+
self.strings = strings
2729
self.fontSize = fontSize
2830

2931
super.init()

submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ private final class GiftViewSheetContent: CombinedComponent {
557557
))
558558
}
559559

560-
if savedToProfile {
560+
if incoming && savedToProfile {
561561
tableItems.append(.init(
562562
id: "visibility",
563563
title: strings.Gift_View_Visibility,
@@ -1028,19 +1028,11 @@ public class GiftViewScreen: ViewControllerComponentContainer {
10281028
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
10291029

10301030
if currentTime > starsConvertMaxDate {
1031-
//TODO:localize
1032-
1033-
let duration: String
1034-
if starsConvertMaxDate == 300 {
1035-
duration = "5 minutes"
1036-
} else {
1037-
duration = "90 days"
1038-
}
1039-
1031+
let days: Int32 = Int32(ceil(Float(configuration.convertToStarsPeriod) / 86400.0))
10401032
let controller = textAlertController(
10411033
context: self.context,
10421034
title: presentationData.strings.Gift_Convert_Title,
1043-
text: "Sorry, you can't convert this gift.\n\nStars can only be claimed within \(duration) after receiving a gift.",
1035+
text: presentationData.strings.Gift_Convert_Period_Unavailable_Text(presentationData.strings.Gift_Convert_Period_Unavailable_Days(days)).string,
10441036
actions: [
10451037
TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})
10461038
],
@@ -1049,14 +1041,9 @@ public class GiftViewScreen: ViewControllerComponentContainer {
10491041
self.present(controller, in: .window(.root))
10501042
} else {
10511043
let delta = starsConvertMaxDate - currentTime
1052-
let duration: String
1053-
if starsConvertMaxDate == 300 {
1054-
duration = "\(delta / 60) minutes"
1055-
} else {
1056-
duration = "\(delta / 86400) days"
1057-
}
1058-
//TODO:localize
1059-
let text = "Do you want to convert this gift from **\(fromPeerName)** to **\(presentationData.strings.Gift_Convert_Stars(Int32(arguments.convertStars)))**?\n\nConversion is available for the next \(duration).\n\nThis will permanently destroy the gift."
1044+
let days: Int32 = Int32(ceil(Float(delta) / 86400.0))
1045+
1046+
let text = presentationData.strings.Gift_Convert_Period_Text(fromPeerName, presentationData.strings.Gift_Convert_Period_Stars(Int32(arguments.convertStars)), presentationData.strings.Gift_Convert_Period_Days(days)).string
10601047
let controller = textAlertController(
10611048
context: self.context,
10621049
title: presentationData.strings.Gift_Convert_Title,

submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/ContextResultPanelComponent.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ final class ContextResultPanelComponent: Component {
233233
}
234234

235235
if let peer, let addressName = peer.addressName, hashtagIndex < 0 {
236-
//TODO: localize
237236
var isGroup = false
238237
if case let .channel(channel) = peer, case .group = channel.info {
239238
isGroup = true
@@ -245,8 +244,8 @@ final class ContextResultPanelComponent: Component {
245244
theme: component.theme,
246245
strings: component.strings,
247246
peer: nil,
248-
title: "Use #\(query)",
249-
subtitle: "searches posts from all channels",
247+
title: component.strings.Chat_HashtagSuggestion_UseGeneric_Title("#\(query)").string,
248+
subtitle: component.strings.Chat_HashtagSuggestion_UseGeneric_Text,
250249
hashtag: query,
251250
hasNext: index != hashtags.count - 1,
252251
action: { [weak self] hashtag, _ in
@@ -262,8 +261,8 @@ final class ContextResultPanelComponent: Component {
262261
theme: component.theme,
263262
strings: component.strings,
264263
peer: peer,
265-
title: "Use #\(query)@\(addressName)",
266-
subtitle: isGroup ? "searches only posts from this group" : "searches only posts from this channel",
264+
title: component.strings.Chat_HashtagSuggestion_UseLocal_Title("#\(query)@\(addressName)").string,
265+
subtitle: isGroup ? component.strings.Chat_HashtagSuggestion_UseLocal_Group_Text : component.strings.Chat_HashtagSuggestion_UseLocal_Channel_Text,
267266
hashtag: "\(query)@\(addressName)",
268267
hasNext: index != hashtags.count - 1,
269268
action: { [weak self] hashtag, _ in

submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoPaneContainerNode.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ final class PeerInfoPaneTabsContainerPaneNode: ASDisplayNode {
7474
if !icons.isEmpty {
7575
if self.iconLayers.isEmpty {
7676
for icon in icons {
77-
let iconSize = CGSize(width: 24.0, height: 24.0)
77+
let iconSize = CGSize(width: 18.0, height: 18.0)
7878

7979
let emoji = ChatTextInputTextCustomEmojiAttribute(
8080
interactivelySelectedFromPackId: nil,
@@ -121,11 +121,11 @@ final class PeerInfoPaneTabsContainerPaneNode: ASDisplayNode {
121121
totalWidth = titleSize.width
122122

123123
if !self.iconLayers.isEmpty {
124-
totalWidth += 1.0
125-
let iconSize = CGSize(width: 24.0, height: 24.0)
124+
totalWidth += 2.0
125+
let iconSize = CGSize(width: 18.0, height: 18.0)
126126
let spacing: CGFloat = 1.0
127127
for iconlayer in self.iconLayers {
128-
iconlayer.frame = CGRect(origin: CGPoint(x: totalWidth, y: 12.0), size: iconSize)
128+
iconlayer.frame = CGRect(origin: CGPoint(x: totalWidth, y: 15.0), size: iconSize)
129129
totalWidth += iconSize.width + spacing
130130
}
131131
totalWidth -= spacing

submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,6 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
15131513
let overallStarsBalance = data.starsRevenueStatsState?.balances.overallRevenue ?? 0
15141514

15151515
if overallRevenueBalance > 0 || overallStarsBalance > 0 {
1516-
//TODO:localize
15171516
items[.balances]!.append(PeerInfoScreenHeaderItem(id: 20, text: presentationData.strings.PeerInfo_BotBalance_Title))
15181517
if overallRevenueBalance > 0 {
15191518
let string = "*\(formatTonAmountText(revenueBalance, dateTimeFormat: presentationData.dateTimeFormat))"

submodules/TelegramUI/Components/Stars/StarsTransactionScreen/Sources/StarsTransactionScreen.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,10 @@ private final class StarsTransactionSheetContent: CombinedComponent {
947947
return nil
948948
}
949949
},
950-
tapAction: { _, _ in
951-
openAppExamples()
950+
tapAction: { attributes, _ in
951+
if let _ = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] {
952+
openAppExamples()
953+
}
952954
}
953955
),
954956
availableSize: CGSize(width: context.availableSize.width - sideInset * 2.0 - 60.0, height: CGFloat.greatestFiniteMagnitude),

submodules/TelegramUI/Sources/ChatAdPanelNode.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ final class ChatAdPanelNode: ASDisplayNode {
338338
if let imageDimensions {
339339
applyImage = imageNodeLayout(TransformImageArguments(corners: ImageCorners(radius: 3.0), imageSize: imageDimensions.aspectFilled(imageBoundingSize), boundingSize: imageBoundingSize, intrinsicInsets: UIEdgeInsets()))
340340
textRightInset += imageBoundingSize.width + 18.0
341+
} else {
342+
textRightInset = 27.0
341343
}
342344

343345
var mediaUpdated = false

submodules/TelegramUI/Sources/HashtagChatInputContextPanelNode.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,14 @@ final class HashtagChatInputContextPanelNode: ChatInputContextPanelNode {
120120
if let peer, let _ = peer.addressName {
121121
isAdditionalRecent = true
122122
}
123-
//TODO:localize
124-
if query.count > 3 {
123+
if query.count >= 4 {
125124
if let peer, let addressName = peer.addressName {
126125
let genericEntry = HashtagChatInputContextPanelEntry(
127126
index: 0,
128127
theme: self.theme,
129128
peer: nil,
130-
title: "Use #\(query)",
131-
text: "searches posts from all channels",
129+
title: self.strings.Chat_HashtagSuggestion_UseGeneric_Title("#\(query)").string,
130+
text: self.strings.Chat_HashtagSuggestion_UseGeneric_Text,
132131
badge: nil,
133132
hashtag: query,
134133
revealed: false,
@@ -145,9 +144,9 @@ final class HashtagChatInputContextPanelNode: ChatInputContextPanelNode {
145144
index: 1,
146145
theme: self.theme,
147146
peer: peer,
148-
title: "Use #\(query)@\(addressName)",
149-
text: isGroup ? "searches only posts from this group" : "searches only posts from this channel",
150-
badge: "NEW",
147+
title: self.strings.Chat_HashtagSuggestion_UseLocal_Title("#\(query)@\(addressName)").string,
148+
text: isGroup ? self.strings.Chat_HashtagSuggestion_UseLocal_Group_Text : self.strings.Chat_HashtagSuggestion_UseLocal_Channel_Text,
149+
badge: self.strings.ChatList_ContextMenuBadgeNew,
151150
hashtag: "\(query)@\(addressName)",
152151
revealed: false,
153152
isAdditionalRecent: false

submodules/TelegramUI/Sources/HorizontalListContextResultsChatInputContextPanelNode.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ private func preparedTransition(from fromEntries: [HorizontalListContextResultsC
8282
}
8383

8484
final class HorizontalListContextResultsChatInputContextPanelNode: ChatInputContextPanelNode {
85-
private var strings: PresentationStrings
86-
8785
private let listView: ListView
8886
private let separatorNode: ASDisplayNode
8987
private var currentExternalResults: ChatContextResultCollection?
@@ -96,8 +94,6 @@ final class HorizontalListContextResultsChatInputContextPanelNode: ChatInputCont
9694
private var hasValidLayout = false
9795

9896
override init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, fontSize: PresentationFontSize, chatPresentationContext: ChatPresentationContext) {
99-
self.strings = strings
100-
10197
self.separatorNode = ASDisplayNode()
10298
self.separatorNode.isLayerBacked = true
10399
self.separatorNode.backgroundColor = theme.list.itemPlainSeparatorColor

0 commit comments

Comments
 (0)