mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Improve giveaway localization
This commit is contained in:
parent
624155ae99
commit
ca31e5eac8
@ -10379,6 +10379,8 @@ Sorry for the inconvenience.";
|
||||
"Chat.Giveaway.Message.PrizeText" = "%1$@ for %2$@.";
|
||||
"Chat.Giveaway.Message.Subscriptions_1" = "**%@** Telegram Premium Subscription";
|
||||
"Chat.Giveaway.Message.Subscriptions_any" = "**%@** Telegram Premium Subscriptions";
|
||||
"Chat.Giveaway.Message.WithSubscriptions_1" = "**%@** Telegram Premium Subscription";
|
||||
"Chat.Giveaway.Message.WithSubscriptions_any" = "**%@** Telegram Premium Subscriptions";
|
||||
"Chat.Giveaway.Message.Months_1" = "**%@** month";
|
||||
"Chat.Giveaway.Message.Months_any" = "**%@** months";
|
||||
"Chat.Giveaway.Message.ParticipantsTitle" = "Participants";
|
||||
@ -10392,6 +10394,8 @@ Sorry for the inconvenience.";
|
||||
"Chat.Giveaway.Message.DateTitle" = "Winners Selection Date";
|
||||
"Chat.Giveaway.Message.LearnMore" = "LEARN MORE";
|
||||
"Chat.Giveaway.Message.With" = "with";
|
||||
"Chat.Giveaway.Message.CustomPrizeQuantity_1" = "%@";
|
||||
"Chat.Giveaway.Message.CustomPrizeQuantity_any" = "%@";
|
||||
|
||||
"GiftLink.Title" = "Gift Link";
|
||||
"GiftLink.UsedTitle" = "Used Gift Link";
|
||||
|
@ -298,7 +298,8 @@ public class ChatMessageGiveawayBubbleContentNode: ChatMessageBubbleContentNode,
|
||||
var trimSubscriptionCount = false
|
||||
if let prizeDescription {
|
||||
additionalPrizeSeparatorString = NSAttributedString(string: item.presentationData.strings.Chat_Giveaway_Message_With, font: textFont, textColor: secondaryTextColor)
|
||||
additionalPrizeTextString = parseMarkdownIntoAttributedString("**\(giveaway.quantity)** \(prizeDescription)", attributes: MarkdownAttributes(
|
||||
let quantityString = item.presentationData.strings.Chat_Giveaway_Message_CustomPrizeQuantity(giveaway.quantity)
|
||||
additionalPrizeTextString = parseMarkdownIntoAttributedString("**\(quantityString)** \(prizeDescription)", attributes: MarkdownAttributes(
|
||||
body: MarkdownAttributeSet(font: textFont, textColor: textColor),
|
||||
bold: MarkdownAttributeSet(font: boldTextFont, textColor: textColor),
|
||||
link: MarkdownAttributeSet(font: textFont, textColor: textColor),
|
||||
@ -311,6 +312,7 @@ public class ChatMessageGiveawayBubbleContentNode: ChatMessageBubbleContentNode,
|
||||
|
||||
var subscriptionsString = item.presentationData.strings.Chat_Giveaway_Message_Subscriptions(giveaway.quantity)
|
||||
if trimSubscriptionCount {
|
||||
subscriptionsString = item.presentationData.strings.Chat_Giveaway_Message_WithSubscriptions(giveaway.quantity)
|
||||
subscriptionsString = subscriptionsString.replacingOccurrences(of: "**\(giveaway.quantity)** ", with: "")
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ final class MediaEditorComposer {
|
||||
}
|
||||
|
||||
var previousAdditionalInput: Input?
|
||||
func process(main: Input, additional: Input?, pool: CVPixelBufferPool?, completion: @escaping (CVPixelBuffer?) -> Void) {
|
||||
func process(main: Input, additional: Input?, timestamp: CMTime, pool: CVPixelBufferPool?, completion: @escaping (CVPixelBuffer?) -> Void) {
|
||||
guard let pool, let ciContext = self.ciContext else {
|
||||
completion(nil)
|
||||
return
|
||||
@ -147,10 +147,8 @@ final class MediaEditorComposer {
|
||||
var pixelBuffer: CVPixelBuffer?
|
||||
CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, pool, &pixelBuffer)
|
||||
|
||||
if let pixelBuffer {
|
||||
let time = main.timestamp
|
||||
|
||||
makeEditorImageFrameComposition(context: ciContext, inputImage: ciImage, drawingImage: self.drawingImage, dimensions: self.dimensions, outputDimensions: self.outputDimensions, values: self.values, entities: self.entities, time: time, completion: { compositedImage in
|
||||
if let pixelBuffer {
|
||||
makeEditorImageFrameComposition(context: ciContext, inputImage: ciImage, drawingImage: self.drawingImage, dimensions: self.dimensions, outputDimensions: self.outputDimensions, values: self.values, entities: self.entities, time: timestamp, completion: { compositedImage in
|
||||
if var compositedImage {
|
||||
let scale = self.outputDimensions.width / compositedImage.extent.width
|
||||
compositedImage = compositedImage.samplingLinear().transformed(by: CGAffineTransform(scaleX: scale, y: scale))
|
||||
|
@ -797,6 +797,7 @@ public final class MediaEditorVideoExport {
|
||||
composer.process(
|
||||
main: mainInput!,
|
||||
additional: additionalInput,
|
||||
timestamp: timestamp,
|
||||
pool: writer.pixelBufferPool,
|
||||
completion: { pixelBuffer in
|
||||
if let pixelBuffer {
|
||||
@ -805,10 +806,6 @@ public final class MediaEditorVideoExport {
|
||||
appendFailed = true
|
||||
}
|
||||
} else {
|
||||
// if !writer.appendVideoBuffer(sampleBuffer) {
|
||||
// writer.markVideoAsFinished()
|
||||
// appendFailed = true
|
||||
// }
|
||||
appendFailed = true
|
||||
}
|
||||
self.semaphore.signal()
|
||||
@ -882,9 +879,6 @@ public final class MediaEditorVideoExport {
|
||||
|
||||
self.internalStatus = .exporting
|
||||
|
||||
if let timeRange = self.reader?.timeRange {
|
||||
print("reader timerange: \(timeRange)")
|
||||
}
|
||||
writer.startSession(atSourceTime: self.reader?.timeRange.start ?? .zero)
|
||||
|
||||
var videoCompleted = false
|
||||
|
@ -595,9 +595,9 @@ final class StoryItemSetViewListComponent: Component {
|
||||
component.openPeer(peer)
|
||||
}
|
||||
},
|
||||
contextAction: item.peer.id != component.context.account.peerId ? { peer, view, gesture in
|
||||
contextAction: component.peerId.isGroupOrChannel || item.peer.id == component.context.account.peerId ? nil : { peer, view, gesture in
|
||||
component.peerContextAction(peer, view, gesture)
|
||||
} : nil,
|
||||
},
|
||||
openStories: { [weak self] peer, avatarNode in
|
||||
guard let self, let component = self.component else {
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user