diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 0ff2b26bf7..6a615b4b2a 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -12900,11 +12900,13 @@ Sorry for the inconvenience."; "Stats.Boosts.Stars_1" = "%@ Star"; "Stats.Boosts.Stars_any" = "%@ Stars"; -"Stats.Boosts.StarsBoosts" = "12-month boosts"; +"Stats.Boosts.StarsWinners_1" = "for %@ winner"; +"Stats.Boosts.StarsWinners_any" = "among %@ winners"; "BoostGift.PrepaidGiveaway.StarsCount_1" = "%@ Star"; "BoostGift.PrepaidGiveaway.StarsCount_any" = "%@ Stars"; -"BoostGift.PrepaidGiveaway.StarsBoosts" = "12-month boosts"; +"BoostGift.PrepaidGiveaway.StarsWinners_1" = "for %@ winner"; +"BoostGift.PrepaidGiveaway.StarsWinners_any" = "among %@ winners"; "Stars.Transaction.Giveaway.Boost.Stars_1" = "%@ Star"; "Stars.Transaction.Giveaway.Boost.Stars_any" = "%@ Stars"; diff --git a/submodules/PremiumUI/Sources/CreateGiveawayController.swift b/submodules/PremiumUI/Sources/CreateGiveawayController.swift index 72f271cc37..3e6c32d5b0 100644 --- a/submodules/PremiumUI/Sources/CreateGiveawayController.swift +++ b/submodules/PremiumUI/Sources/CreateGiveawayController.swift @@ -779,13 +779,13 @@ private func createGiveawayControllerEntries( text = presentationData.strings.BoostGift_PrepaidGiveawayMonths("\(months)").string case let .stars(stars, _): title = presentationData.strings.BoostGift_PrepaidGiveaway_StarsCount(Int32(stars)) - text = presentationData.strings.BoostGift_PrepaidGiveaway_StarsBoosts + text = presentationData.strings.BoostGift_PrepaidGiveaway_StarsWinners(prepaidGiveaway.quantity) } entries.append(.prepaid(presentationData.theme, title, text, prepaidGiveaway)) } var starsPerUser: Int64 = 0 - if case .starsGiveaway = state.mode, !starsGiveawayOptions.isEmpty { + if case .generic = subject, case .starsGiveaway = state.mode, !starsGiveawayOptions.isEmpty { let selectedOption = starsGiveawayOptions.first(where: { $0.giveawayOption.count == state.stars })! entries.append(.starsHeader(presentationData.theme, presentationData.strings.BoostGift_Stars_Title.uppercased(), presentationData.strings.BoostGift_Stars_Boosts(selectedOption.giveawayOption.yearlyBoosts).uppercased())) @@ -868,14 +868,17 @@ private func createGiveawayControllerEntries( switch state.mode { case .giveaway, .starsGiveaway: if case .starsGiveaway = state.mode { - var values: [Int32] = [1] - if let selectedOption = starsGiveawayOptions.first(where: { $0.giveawayOption.count == state.stars }) { - values = selectedOption.giveawayOption.winners.map { $0.users } - } - if values.count > 1 { - entries.append(.subscriptionsHeader(presentationData.theme, presentationData.strings.BoostGift_Stars_Winners, "")) - entries.append(.subscriptions(presentationData.theme, state.winners, values)) - entries.append(.subscriptionsInfo(presentationData.theme, presentationData.strings.BoostGift_Stars_WinnersInfo)) + if case .prepaid = subject { + } else { + var values: [Int32] = [1] + if let selectedOption = starsGiveawayOptions.first(where: { $0.giveawayOption.count == state.stars }) { + values = selectedOption.giveawayOption.winners.map { $0.users } + } + if values.count > 1 { + entries.append(.subscriptionsHeader(presentationData.theme, presentationData.strings.BoostGift_Stars_Winners, "")) + entries.append(.subscriptions(presentationData.theme, state.winners, values)) + entries.append(.subscriptionsInfo(presentationData.theme, presentationData.strings.BoostGift_Stars_WinnersInfo)) + } } } else { if case .generic = subject { @@ -1023,9 +1026,11 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio let initialSubscriptions: Int32 let initialStars: Int64 let initialWinners: Int32 + var initialMode: CreateGiveawayControllerState.Mode = .giveaway if case let .prepaid(prepaidGiveaway) = subject { if case let .stars(stars, _) = prepaidGiveaway.prize { initialStars = stars + initialMode = .starsGiveaway } else { initialStars = 500 } @@ -1052,7 +1057,7 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio let minDate = currentTime + 60 * 1 let maxDate = currentTime + context.userLimits.maxGiveawayPeriodSeconds - let initialState: CreateGiveawayControllerState = CreateGiveawayControllerState(mode: .giveaway, subscriptions: initialSubscriptions, stars: initialStars, winners: initialWinners, time: expiryTime) + let initialState: CreateGiveawayControllerState = CreateGiveawayControllerState(mode: initialMode, subscriptions: initialSubscriptions, stars: initialStars, winners: initialWinners, time: expiryTime) let statePromise = ValuePromise(initialState, ignoreRepeated: true) let stateValue = Atomic(value: initialState) diff --git a/submodules/StatisticsUI/Sources/ChannelStatsController.swift b/submodules/StatisticsUI/Sources/ChannelStatsController.swift index bc9d8bbd65..177019657a 100644 --- a/submodules/StatisticsUI/Sources/ChannelStatsController.swift +++ b/submodules/StatisticsUI/Sources/ChannelStatsController.swift @@ -1448,7 +1448,7 @@ private func boostsEntries( text = presentationData.strings.Stats_Boosts_PrepaidGiveawayMonths("\(months)").string case let .stars(stars, _): title = presentationData.strings.Stats_Boosts_Stars(Int32(stars)) - text = presentationData.strings.Stats_Boosts_StarsBoosts + text = presentationData.strings.Stats_Boosts_StarsWinners(giveaway.quantity) } entries.append(.boostPrepaid(i, presentationData.theme, title, text, giveaway)) i += 1