Skip to content

Commit c4731d8

Browse files
committed
Various improvements
1 parent 9483448 commit c4731d8

File tree

13 files changed

+164
-124
lines changed

13 files changed

+164
-124
lines changed

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14225,3 +14225,68 @@ Sorry for the inconvenience.";
1422514225
"Notification.StarsGift.Bought.Stars_1" = "%@ Star";
1422614226
"Notification.StarsGift.Bought.Stars_any" = "%@ Stars";
1422714227
"Notification.StarsGift.BoughtYou" = "You gifted %1$@ for %2$@";
14228+
"Notification.StarsGift.BoughtForYouself" = "You bought this gift for %1$@";
14229+
14230+
"Gift.View.Context.ChangePrice" = "Change Price";
14231+
"Gift.View.Context.ViewInProfile" = "View in Profile";
14232+
14233+
"Gift.View.Sell" = "sell";
14234+
"Gift.View.Unlist" = "unlist";
14235+
14236+
"Gift.View.BuyFor" = "Buy for";
14237+
"Gift.View.SellingGiftInfo" = "%@ is selling this gift and you can buy it.";
14238+
14239+
"Gift.View.Resale.Success.Title" = "Gift Sent";
14240+
"Gift.View.Resale.Success.Text" = "%@ has been notified about your gift.";
14241+
"Gift.View.Resale.SuccessYou.Title" = "Gift Acquired";
14242+
"Gift.View.Resale.SuccessYou.Text" = "%@ is now yours.";
14243+
14244+
"Gift.View.Resale.Unlist.Title" = "Unlist This Item?";
14245+
"Gift.View.Resale.Unlist.Text" = "It will no longer be for sale.";
14246+
"Gift.View.Resale.Unlist.Unlist" = "Unlist";
14247+
"Gift.View.Resale.Unlist.Success" = "%@ is removed from sale.";
14248+
"Gift.View.Resale.List.Success" = "%@ is now for sale!";
14249+
"Gift.View.Resale.Relist.Success" = "%1$@ is relisted for %2$@.";
14250+
"Gift.View.Resale.Relist.Success.Stars_1" = "%@ Star";
14251+
"Gift.View.Resale.Relist.Success.Stars_any" = "%@ Stars";
14252+
14253+
"Stars.SellGift.Title" = "Sell Gift";
14254+
"Stars.SellGift.EditTitle" = "Edit Price";
14255+
"Stars.SellGift.AmountTitle" = "PRICE IN STARS";
14256+
"Stars.SellGift.AmountPlaceholder" = "Enter Price";
14257+
"Stars.SellGift.AmountInfo" = "You will receive **%@**.";
14258+
"Stars.SellGift.AmountInfo.Stars_1" = "%@ Star";
14259+
"Stars.SellGift.AmountInfo.Stars_any" = "%@ Stars";
14260+
"Stars.SellGift.Sell" = "Sell";
14261+
"Stars.SellGift.SellFor" = "Sell for";
14262+
14263+
"PeerInfo.Gifts.Sale" = "sale";
14264+
14265+
"Gift.Store.ForResale_1" = "%@ for resale";
14266+
"Gift.Store.ForResale_any" = "%@ for resale";
14267+
"Gift.Store.Sort.Price" = "Price";
14268+
"Gift.Store.Sort.Date" = "Date";
14269+
"Gift.Store.Sort.Number" = "Number";
14270+
"Gift.Store.SortByPrice" = "Sort By Price";
14271+
"Gift.Store.SortByDate" = "Sort By Date";
14272+
"Gift.Store.SortByNumber" = "Sort By Number";
14273+
"Gift.Store.Filter.Model" = "Model";
14274+
"Gift.Store.Filter.Backdrop" = "Backdrop";
14275+
"Gift.Store.Filter.Symbol" = "Symbol";
14276+
"Gift.Store.Filter.Selected.Model_1" = "%@ Model";
14277+
"Gift.Store.Filter.Selected.Model_any" = "%@ Models";
14278+
"Gift.Store.Filter.Selected.Backdrop_1" = "%@ Backdrop";
14279+
"Gift.Store.Filter.Selected.Backdrop_any" = "%@ Backdrops";
14280+
"Gift.Store.Filter.Selected.Symbol_1" = "%@ Symbol";
14281+
"Gift.Store.Filter.Selected.Symbol_any" = "%@ Symbols";
14282+
"Gift.Store.Search" = "Search";
14283+
"Gift.Store.SelectAll" = "Select All";
14284+
"Gift.Store.NoResults" = "No Results";
14285+
"Gift.Store.EmptyResults" = "No Matching Gifts";
14286+
"Gift.Store.ClearFilters" = "Clear Filters";
14287+
14288+
"Gift.Send.AvailableForResale" = "Available for Resale";
14289+
14290+
"MediaPicker.CreateStory_1" = "Create %@ Story";
14291+
"MediaPicker.CreateStory_any" = "Create %@ Stories";
14292+
"MediaPicker.CombineIntoCollage" = "Combine into Collage";

submodules/MediaPickerUI/Sources/MediaPickerScreen.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,15 +2395,11 @@ public final class MediaPickerScreenImpl: ViewController, MediaPickerScreen, Att
23952395
transition.updateTransformScale(node: self.moreButtonNode.iconNode, scale: moreIsVisible ? 1.0 : 0.1)
23962396

23972397
if case .assets(_, .story) = self.subject, self.selectionCount > 0 {
2398-
//TODO:localize
2399-
var text = "Create 1 Story"
2400-
if self.selectionCount > 1 {
2401-
text = "Create \(self.selectionCount) Stories"
2402-
}
2398+
let text = self.presentationData.strings.MediaPicker_CreateStory(self.selectionCount)
24032399
self.mainButtonStatePromise.set(.single(AttachmentMainButtonState(text: text, badge: nil, font: .bold, background: .color(self.presentationData.theme.actionSheet.controlAccentColor), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, isVisible: true, progress: .none, isEnabled: true, hasShimmer: false, position: .top)))
24042400

24052401
if self.selectionCount > 1 && self.selectionCount <= 6 {
2406-
self.secondaryButtonStatePromise.set(.single(AttachmentMainButtonState(text: "Combine into Collage", badge: nil, font: .regular, background: .color(.clear), textColor: self.presentationData.theme.actionSheet.controlAccentColor, isVisible: true, progress: .none, isEnabled: true, hasShimmer: false, iconName: "Media Editor/Collage", smallSpacing: true, position: .bottom)))
2402+
self.secondaryButtonStatePromise.set(.single(AttachmentMainButtonState(text: self.presentationData.strings.MediaPicker_CombineIntoCollage, badge: nil, font: .regular, background: .color(.clear), textColor: self.presentationData.theme.actionSheet.controlAccentColor, isVisible: true, progress: .none, isEnabled: true, hasShimmer: false, iconName: "Media Editor/Collage", smallSpacing: true, position: .bottom)))
24072403
} else {
24082404
self.secondaryButtonStatePromise.set(.single(nil))
24092405
}

submodules/MtProtoKit/Sources/MTApiEnvironment.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ - (NSString *)platformString
542542
return @"iPhone 16 Pro";
543543
if ([platform isEqualToString:@"iPhone17,2"])
544544
return @"iPhone 16 Pro Max";
545+
if ([platform isEqualToString:@"iPhone17,5"])
546+
return @"iPhone 16e";
545547

546548
if ([platform hasPrefix:@"iPod1"])
547549
return @"iPod touch 1G";

submodules/TelegramCore/Sources/TelegramEngine/Payments/StarGifts.swift

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,13 +1534,28 @@ private final class ProfileGiftsContextImpl {
15341534
guard let self else {
15351535
return EmptyDisposable
15361536
}
1537+
1538+
var saveToProfile = false
1539+
if let gift = self.gifts.first(where: { $0.reference == reference }) {
1540+
if !gift.savedToProfile {
1541+
saveToProfile = true
1542+
}
1543+
} else if let gift = self.filteredGifts.first(where: { $0.reference == reference }) {
1544+
if !gift.savedToProfile {
1545+
saveToProfile = true
1546+
}
1547+
}
1548+
1549+
var signal = _internal_updateStarGiftResalePrice(account: self.account, reference: reference, price: price)
1550+
if saveToProfile {
1551+
signal = _internal_updateStarGiftAddedToProfile(account: self.account, reference: reference, added: true)
1552+
|> castError(UpdateStarGiftPriceError.self)
1553+
|> then(signal)
1554+
}
1555+
15371556
let disposable = MetaDisposable()
15381557
disposable.set(
1539-
(_internal_updateStarGiftResalePrice(
1540-
account: self.account,
1541-
reference: reference,
1542-
price: price
1543-
)
1558+
(signal
15441559
|> deliverOn(self.queue)).startStrict(error: { error in
15451560
subscriber.putError(error)
15461561
}, completed: {
@@ -1562,7 +1577,7 @@ private final class ProfileGiftsContextImpl {
15621577
}) {
15631578
if case let .unique(uniqueGift) = self.gifts[index].gift {
15641579
let updatedUniqueGift = uniqueGift.withResellStars(price)
1565-
let updatedGift = self.gifts[index].withGift(.unique(updatedUniqueGift))
1580+
let updatedGift = self.gifts[index].withGift(.unique(updatedUniqueGift)).withSavedToProfile(true)
15661581
self.gifts[index] = updatedGift
15671582
}
15681583
}
@@ -1585,7 +1600,7 @@ private final class ProfileGiftsContextImpl {
15851600
}) {
15861601
if case let .unique(uniqueGift) = self.filteredGifts[index].gift {
15871602
let updatedUniqueGift = uniqueGift.withResellStars(price)
1588-
let updatedGift = self.filteredGifts[index].withGift(.unique(updatedUniqueGift))
1603+
let updatedGift = self.filteredGifts[index].withGift(.unique(updatedUniqueGift)).withSavedToProfile(true)
15891604
self.filteredGifts[index] = updatedGift
15901605
}
15911606
}

submodules/TelegramStringFormatting/Sources/ServiceMessageStrings.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,8 +1190,12 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
11901190
} else if message.author?.id == accountPeerId {
11911191
if let resaleStars {
11921192
let starsString = strings.Notification_StarsGift_Bought_Stars(Int32(resaleStars))
1193-
let giftTitle = "\(gift.title) #\(presentationStringsFormattedNumber(gift.number, dateTimeFormat.groupingSeparator))"
1194-
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGift_BoughtYou(giftTitle, starsString)._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes, 1: boldAttributes])
1193+
if message.id.peerId == accountPeerId {
1194+
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGift_BoughtForYouself(starsString)._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes])
1195+
} else {
1196+
let giftTitle = "\(gift.title) #\(presentationStringsFormattedNumber(gift.number, dateTimeFormat.groupingSeparator))"
1197+
attributedString = addAttributesToStringWithRanges(strings.Notification_StarsGift_BoughtYou(giftTitle, starsString)._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes, 1: boldAttributes])
1198+
}
11951199
} else {
11961200
attributedString = NSAttributedString(string: strings.Notification_StarsGift_TransferYou, font: titleFont, textColor: primaryTextColor)
11971201
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ final class GiftSetupScreenComponent: Component {
801801
title: AnyComponent(VStack([
802802
AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(
803803
MultilineTextComponent(
804-
text: .plain(NSAttributedString(string: "Available for Resale", font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: environment.theme.list.itemPrimaryTextColor))
804+
text: .plain(NSAttributedString(string: environment.strings.Gift_Send_AvailableForResale, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: environment.theme.list.itemPrimaryTextColor))
805805
)
806806
)),
807807
], alignment: .left, spacing: 2.0)),
@@ -1770,6 +1770,8 @@ public final class GiftSetupScreen: ViewControllerComponentContainer {
17701770

17711771
self.title = ""
17721772

1773+
self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.context.sharedContext.currentPresentationData.with { $0 }.strings.Common_Back, style: .plain, target: nil, action: nil)
1774+
17731775
self.scrollToTop = { [weak self] in
17741776
guard let self, let componentView = self.node.hostView.componentView as? GiftSetupScreenComponent.View else {
17751777
return

submodules/TelegramUI/Components/Gifts/GiftStoreScreen/Sources/GiftAttributeListContextItem.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ private final class GiftAttributeListContextItemNode: ASDisplayNode, ContextMenu
218218

219219
let selectedAttributes = Set(item.selectedAttributes)
220220

221-
//TODO:localize
222-
let selectAllAction = ContextMenuActionItem(text: "Select All", icon: { theme in
221+
let selectAllAction = ContextMenuActionItem(text: presentationData.strings.Gift_Store_SelectAll, icon: { theme in
223222
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor)
224223
}, iconPosition: .left, action: { _, f in
225224
getController()?.dismiss(result: .dismissWithoutContent, completion: nil)
@@ -248,7 +247,7 @@ private final class GiftAttributeListContextItemNode: ASDisplayNode, ContextMenu
248247
}
249248

250249
let nopAction: ((ContextControllerProtocol?, @escaping (ContextMenuActionResult) -> Void) -> Void)? = nil
251-
let emptyResultsAction = ContextMenuActionItem(text: "No Results", textFont: .small, icon: { _ in return nil }, action: nopAction)
250+
let emptyResultsAction = ContextMenuActionItem(text: presentationData.strings.Gift_Store_NoResults, textFont: .small, icon: { _ in return nil }, action: nopAction)
252251
let emptyResultsActionNode = ContextControllerActionsListActionItemNode(context: item.context, getController: getController, requestDismiss: actionSelected, requestUpdateAction: { _, _ in }, item: emptyResultsAction)
253252
actionNodes.append(emptyResultsActionNode)
254253

@@ -412,12 +411,6 @@ private final class GiftAttributeListContextItemNode: ASDisplayNode, ContextMenu
412411
}
413412

414413
func actionNode(at point: CGPoint) -> ContextActionNodeProtocol {
415-
// for actionNode in self.actionNodes {
416-
// let frame = actionNode.convert(actionNode.bounds, to: self)
417-
// if frame.contains(point) {
418-
// return actionNode
419-
// }
420-
// }
421414
return self
422415
}
423416

0 commit comments

Comments
 (0)