From 4016ae8a252afe4be4cbc167f2e25e6184d98a8b Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 29 Jun 2025 14:54:42 +0200 Subject: [PATCH] Update localization --- .../Telegram-iOS/en.lproj/Localizable.strings | 18 +++++++++++++++++- .../PremiumUI/Sources/PremiumIntroScreen.swift | 5 ++--- .../ChatMessageGiftBubbleContentNode.swift | 2 +- .../ChatMessageTodoBubbleContentNode.swift | 13 ++++++------- .../Sources/PeerInfoScreen.swift | 3 +-- .../Sources/StarsTransactionScreen.swift | 3 +-- .../Sources/StarsTransactionsScreen.swift | 5 ++--- 7 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 8fbcc99a42..6ff2b8241a 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -14485,7 +14485,6 @@ Sorry for the inconvenience."; "Chat.Todo.Message.Title" = "Checklist"; "Chat.Todo.Message.TitleGroup" = "Group Checklist"; "Chat.Todo.Message.TitlePersonal" = "%@'s Checklist"; -"Chat.Todo.Message.CompletedPersonal" = "%@'s Checklist"; "Chat.Todo.ContextMenu.AddTask" = "Add a Task"; "Chat.Todo.ContextMenu.EditTask" = "Edit Item"; @@ -14507,3 +14506,20 @@ Sorry for the inconvenience."; "ScheduledMessages.TodoUnavailable" = "Completing tasks will become available after the message is published."; "Attachment.DiscardTodoAlertText" = "Discard checklist items?"; + +"Premium.Week.SignUp" = "Sign up for %@"; +"Premium.Week.SignUpInfo" = "Get Telegram Premium for 1 week"; + +"Settings.MyTon" = "My TON"; + +"Stars.Gift.Ton.Text" = "Use TON to submit post suggestions to channels on Telegram."; +"Stars.Ton.Title" = "TON"; +"Stars.Ton.Description" = "Use TON to submit post suggestions to channels on Telegram."; + +"Notification.Ton.Subtitle" = "Use TON to submit post suggestions to channels."; +"Notification.Ton.SubtitleYou" = "With TON, %@ will be able to submit post suggestions to channels."; + +"Chat.Todo.Message.Completed_1" = "%@ of {count} completed"; +"Chat.Todo.Message.Completed_any" = "%@ of {count} completed"; +"Chat.Todo.Message.CompletedBy_1" = "%@ of {count} completed by {name}"; +"Chat.Todo.Message.CompletedBy_any" = "%@ of {count} completed by {name}"; diff --git a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift index 23b85bf85f..d35676d1af 100644 --- a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift @@ -3702,9 +3702,8 @@ private final class PremiumIntroScreenComponent: CombinedComponent { let buttonTitle: String var buttonSubtitle: String? if case let .auth(price) = context.component.source { - //TODO:localize - buttonTitle = "Sign up for \(price)" - buttonSubtitle = "Get Telegram Premium for 1 week" + buttonTitle = environment.strings.Premium_Week_SignUp(price).string + buttonSubtitle = environment.strings.Premium_Week_SignUpInfo } else if isUnusedGift { buttonTitle = environment.strings.Premium_Gift_ApplyLink } else if state.isPremium == true && state.canUpgrade { diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift index 6bdd21ecc7..08856d1830 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift @@ -433,7 +433,7 @@ public class ChatMessageGiftBubbleContentNode: ChatMessageBubbleContentNode { let cryptoAmount = cryptoAmount ?? 0 title = "$ \(formatTonAmountText(cryptoAmount, dateTimeFormat: item.presentationData.dateTimeFormat, maxDecimalPositions: 3))" - text = incoming ? "Use TON to submit post suggestions to channels." : "With TON, \(peerName) will be able to submit post suggestions to channels." + text = incoming ? item.presentationData.strings.Notification_Ton_Subtitle : item.presentationData.strings.Notification_Ton_SubtitleYou(peerName).string buttonTitle = "" case let .prizeStars(count, _, channelId, _, _): if count <= 1000 { diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageTodoBubbleContentNode/Sources/ChatMessageTodoBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageTodoBubbleContentNode/Sources/ChatMessageTodoBubbleContentNode.swift index fe537f66c2..bcbbcb0fe5 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageTodoBubbleContentNode/Sources/ChatMessageTodoBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageTodoBubbleContentNode/Sources/ChatMessageTodoBubbleContentNode.swift @@ -663,12 +663,11 @@ private final class ChatMessageTodoItemNode: ASDisplayNode { optionEntities.append(MessageTextEntity(range: 0 ..< (optionText as NSString).length, type: .Strikethrough)) } - let optionTextColor: UIColor = messageTheme.primaryTextColor let optionAttributedText = stringWithAppliedEntities( optionText, entities: optionEntities, - baseColor: optionTextColor, - linkColor: optionTextColor, + baseColor: messageTheme.primaryTextColor, + linkColor: messageTheme.linkTextColor, baseFont: presentationData.messageFont, linkFont: presentationData.messageFont, boldFont: presentationData.messageFont, @@ -1155,15 +1154,15 @@ public class ChatMessageTodoBubbleContentNode: ChatMessageBubbleContentNode { let (typeLayout, typeApply) = makeTypeLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: typeText, font: labelsFont, textColor: messageTheme.secondaryTextColor), backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: textConstrainedSize, alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - - //TODO:localize var bottomText: String = "" if let todo { + let format: String if let author = item.message.author, author.id != item.context.account.peerId && !todo.flags.contains(.othersCanComplete) { - bottomText = "\(todo.completions.count) of \(todo.items.count) completed by \(EnginePeer(author).compactDisplayTitle)" + format = item.presentationData.strings.Chat_Todo_Message_CompletedBy(Int32(todo.completions.count)).replacingOccurrences(of: "{name}", with: EnginePeer(author).compactDisplayTitle) } else { - bottomText = "\(todo.completions.count) of \(todo.items.count) completed" + format = item.presentationData.strings.Chat_Todo_Message_Completed(Int32(todo.completions.count)) } + bottomText = format.replacingOccurrences(of: "{count}", with: "\(todo.items.count)") } let (buttonViewResultsTextLayout, buttonViewResultsTextApply) = makeViewResultsTextLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: bottomText, font: labelsFont, textColor: messageTheme.secondaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: textConstrainedSize, alignment: .natural, cutout: nil, insets: textInsets)) diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 2195d81ebc..d70e5ecc2b 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -1048,8 +1048,7 @@ private func settingsItems(data: PeerInfoScreenData?, context: AccountContext, p } else { balanceText = NSAttributedString() } - //TODO:localize - items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 103, label: .attributedText(balanceText), text: "My TON", icon: PresentationResourcesSettings.ton, action: { + items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 103, label: .attributedText(balanceText), text: presentationData.strings.Settings_MyTon, icon: PresentationResourcesSettings.ton, action: { interaction.openSettings(.ton) })) } diff --git a/submodules/TelegramUI/Components/Stars/StarsTransactionScreen/Sources/StarsTransactionScreen.swift b/submodules/TelegramUI/Components/Stars/StarsTransactionScreen/Sources/StarsTransactionScreen.swift index dbab78d84a..03ff9a4aee 100644 --- a/submodules/TelegramUI/Components/Stars/StarsTransactionScreen/Sources/StarsTransactionScreen.swift +++ b/submodules/TelegramUI/Components/Stars/StarsTransactionScreen/Sources/StarsTransactionScreen.swift @@ -418,9 +418,8 @@ private final class StarsTransactionSheetContent: CombinedComponent { titleText = strings.Stars_Gift_Received_Title count = transaction.count - //TODO:localize if count.currency == .ton { - descriptionText = "Use TON to submit post suggestions to channels on Telegram." + descriptionText = strings.Stars_Gift_Ton_Text } else { descriptionText = strings.Stars_Gift_Received_Text } diff --git a/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift b/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift index 539c5481e3..ff8a3c7a0f 100644 --- a/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift +++ b/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift @@ -536,9 +536,8 @@ final class StarsTransactionsScreenComponent: Component { let titleString: String let descriptionString: String if component.starsContext.ton { - //TODO:localize - titleString = "TON" - descriptionString = "Use TON to submit post suggestions to channels on Telegram." + titleString = environment.strings.Stars_Ton_Title + descriptionString = environment.strings.Stars_Ton_Description } else { titleString = environment.strings.Stars_Intro_Title descriptionString = environment.strings.Stars_Intro_Description