Skip to content

Commit 5fe77d8

Browse files
committed
Merge commit 'b1bcf52a09d4a2359ca7e69ac28a92e8e2261b78' into beta
2 parents 27ec161 + b1bcf52 commit 5fe77d8

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15004,3 +15004,7 @@ Sorry for the inconvenience.";
1500415004
"Notification.PrepaidGiftUpgrade" = "Gift Upgrade for %@";
1500515005
"Notification.PrepaidGiftUpgrade.Stars_1" = "%@ Star";
1500615006
"Notification.PrepaidGiftUpgrade.Stars_any" = "%@ Stars";
15007+
15008+
"ProfileLevelInfo.RatingTitle" = "Rating";
15009+
"ProfileLevelInfo.FutureRatingTitle" = "Future Rating";
15010+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
589589
}
590590

591591
var currentSavedMusic: TelegramMediaFile?
592-
if !self.isSettings, let screenData {
592+
if let peer, peer.id != self.context.account.peerId || self.isMyProfile, let screenData {
593593
if let savedMusicState = screenData.savedMusicState {
594594
currentSavedMusic = savedMusicState.files.first
595595
} else if let cachedUserData = screenData.cachedData as? CachedUserData {

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

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -377,24 +377,46 @@ private final class ProfileLevelInfoScreenComponent: Component {
377377
descriptionTextString = environment.strings.ProfileLevelInfo_OtherDescription(component.peer.compactDisplayTitle).string
378378
}
379379

380-
//TODO:localize
381380
var titleItems: [AnimatedTextComponent.Item] = []
381+
382+
let ratingTitle = environment.strings.ProfileLevelInfo_RatingTitle
383+
let futureTitle = environment.strings.ProfileLevelInfo_FutureRatingTitle
384+
382385
if self.isPreviewingPendingRating {
383-
titleItems.append(AnimatedTextComponent.Item(
384-
id: AnyHashable(0),
385-
isUnbreakable: false,
386-
content: .text("Future ")
387-
))
388-
titleItems.append(AnimatedTextComponent.Item(
389-
id: AnyHashable(1),
390-
isUnbreakable: true,
391-
content: .text("Rating")
392-
))
386+
if let range = futureTitle.range(of: ratingTitle) {
387+
if !futureTitle[..<range.lowerBound].isEmpty {
388+
titleItems.append(AnimatedTextComponent.Item(
389+
id: AnyHashable(0),
390+
isUnbreakable: false,
391+
content: .text(String(futureTitle[..<range.lowerBound]))
392+
))
393+
}
394+
395+
titleItems.append(AnimatedTextComponent.Item(
396+
id: AnyHashable(1),
397+
isUnbreakable: true,
398+
content: .text(ratingTitle)
399+
))
400+
401+
if !futureTitle[range.upperBound...].isEmpty {
402+
titleItems.append(AnimatedTextComponent.Item(
403+
id: AnyHashable(2),
404+
isUnbreakable: false,
405+
content: .text(String(futureTitle[range.upperBound...]))
406+
))
407+
}
408+
} else {
409+
titleItems.append(AnimatedTextComponent.Item(
410+
id: AnyHashable(0),
411+
isUnbreakable: true,
412+
content: .text(futureTitle)
413+
))
414+
}
393415
} else {
394416
titleItems.append(AnimatedTextComponent.Item(
395417
id: AnyHashable(1),
396418
isUnbreakable: true,
397-
content: .text("Rating")
419+
content: .text(ratingTitle)
398420
))
399421
}
400422

0 commit comments

Comments
 (0)