From 3985c538a8b07af04d0f6b5f1389769a85c5828d Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 26 May 2025 01:05:11 +0200 Subject: [PATCH] Update localization --- .../Telegram-iOS/en.lproj/Localizable.strings | 27 +++++++++++++++++++ .../Sources/ContactListNode.swift | 3 +-- .../Sources/LimitedPermissionItem.swift | 3 +-- .../TGMediaPickerGalleryInterfaceView.m | 3 +-- .../Sources/MediaPickerScreen.swift | 2 +- .../Sources/SelectablePeerNode.swift | 3 +-- .../Sources/ChatQrCodeScreen.swift | 3 +-- .../Sources/ForumModeComponent.swift | 4 +-- .../Sources/ForumSettingsScreen.swift | 13 +++++---- .../Sources/PeerInfoScreen.swift | 6 ++--- .../Chat/ChatControllerMediaRecording.swift | 6 ++--- 11 files changed, 46 insertions(+), 27 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 3b89811ad0..12c0d44b7e 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -14341,3 +14341,30 @@ Sorry for the inconvenience."; "Chat.PauseVoiceMessageTooltip" = "Pause to trim or replay."; "Chat.PauseVideoMessageTooltip" = "Pause to trim or replay."; + +"Chat.TrimVoiceMessageToResume.Title" = "Trim to selected range?"; +"Chat.TrimVoiceMessageToResume.Text" = "Audio outside that range will be discarded, and recording will start immediately."; +"Chat.TrimVoiceMessageToResume.Proceed" = "Proceed"; + +"Contacts.LimitedAccess.Text" = "You have limited Telegram from accessing all of your contacts."; +"Contacts.LimitedAccess.Manage" = "MANAGE"; + +"Media.PhotoHdOn" = "The photo will be sent in high quality."; +"Media.PhotoHdOff" = "The photo will be sent in standard quality."; + +"Attachment.SendInHd" = "Send in High Quality"; + +"Share.PostToStory" = "Post\nto Story"; + +"PeerInfo.QRCode.Scan" = "Scan QR Code"; + +"PeerInfo.Topics.Title" = "Topics"; +"PeerInfo.Topics.EnableTopics" = "Enable Topics"; +"PeerInfo.Topics.EnableTopicsInfo" = "The group chat will be divided into topics created by admins or users."; +"PeerInfo.Topics.DisplayAs" = "DISPLAY AS"; +"PeerInfo.Topics.DisplayAsInfo" = "Choose how topics appear for all members."; +"PeerInfo.Topics.Tabs" = "Tabs"; +"PeerInfo.Topics.List" = "List"; + +"PeerInfo.OptionTopics.Enabled" = "Enabled"; +"PeerInfo.OptionTopics.Disabled" = "Disabled"; diff --git a/submodules/ContactListUI/Sources/ContactListNode.swift b/submodules/ContactListUI/Sources/ContactListNode.swift index 4be8b9e67c..569cb412d7 100644 --- a/submodules/ContactListUI/Sources/ContactListNode.swift +++ b/submodules/ContactListUI/Sources/ContactListNode.swift @@ -149,8 +149,7 @@ private enum ContactListNodeEntry: Comparable, Identifiable { interaction.authorize() }) case .permissionLimited: - //TODO:localize - return LimitedPermissionItem(presentationData: ItemListPresentationData(presentationData), text: "You have limited Telegram from accessing all of your contacts.", action: { + return LimitedPermissionItem(presentationData: ItemListPresentationData(presentationData), text: presentationData.strings.Contacts_LimitedAccess_Text, action: { interaction.openContactAccessPicker() }) case let .option(_, option, header, _, _): diff --git a/submodules/ContactListUI/Sources/LimitedPermissionItem.swift b/submodules/ContactListUI/Sources/LimitedPermissionItem.swift index d60b6dc794..c9923da2c0 100644 --- a/submodules/ContactListUI/Sources/LimitedPermissionItem.swift +++ b/submodules/ContactListUI/Sources/LimitedPermissionItem.swift @@ -160,8 +160,7 @@ public class LimitedPermissionItemNode: ListViewItemNode { let attributedText = NSAttributedString(string: item.text, font: textFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) - //TODO:localize - let (buttonTextLayout, buttonTextApply) = makeButtonTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: "MANAGE", font: Font.semibold(15.0), textColor: item.presentationData.theme.list.itemCheckColors.foregroundColor), backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (buttonTextLayout, buttonTextApply) = makeButtonTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.presentationData.strings.Contacts_LimitedAccess_Manage, font: Font.semibold(15.0), textColor: item.presentationData.theme.list.itemCheckColors.foregroundColor), backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (textLayout, textApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: attributedText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset - buttonTextLayout.size.width - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) diff --git a/submodules/LegacyComponents/Sources/TGMediaPickerGalleryInterfaceView.m b/submodules/LegacyComponents/Sources/TGMediaPickerGalleryInterfaceView.m index 768ebea28a..514d494001 100644 --- a/submodules/LegacyComponents/Sources/TGMediaPickerGalleryInterfaceView.m +++ b/submodules/LegacyComponents/Sources/TGMediaPickerGalleryInterfaceView.m @@ -1239,8 +1239,7 @@ [self tooltipTimerTick]; } - //TODO:localize - NSString *text = hd ? @"The photo will be sent in high quality." : @"The photo will be sent in standard quality."; + NSString *text = hd ? TGLocalized(@"Media.PhotoHdOn") : TGLocalized(@"Media.PhotoHdOff"); [_context presentTooltip:text icon:[TGPhotoEditorInterfaceAssets qualityIconForHighQuality:hd filled: true] sourceRect:rect]; } diff --git a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift index bc6de55cd1..134cb11f29 100644 --- a/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift +++ b/submodules/MediaPickerUI/Sources/MediaPickerScreen.swift @@ -2719,7 +2719,7 @@ public final class MediaPickerScreenImpl: ViewController, MediaPickerScreen, Att } if price == nil { //TODO:localize - items.append(.action(ContextMenuActionItem(text: "Send in High Quality", icon: { theme in + items.append(.action(ContextMenuActionItem(text: strings.Attachment_SendInHd, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/QualityHd"), color: theme.contextMenu.primaryColor) }, action: { [weak self] _, f in f(.default) diff --git a/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift b/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift index 058037dbd4..d28906ef1a 100644 --- a/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift +++ b/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift @@ -190,8 +190,7 @@ public final class SelectablePeerNode: ASDisplayNode { switch storyMode { case .createStory: - //TODO:localize - title = "Post\nto Story" + title = strings.Share_PostToStory overrideImage = .storyIcon case .repostStory: title = strings.Share_RepostStory diff --git a/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift b/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift index e4e97d3119..e73799fb9f 100644 --- a/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift +++ b/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift @@ -898,9 +898,8 @@ private class ChatQrCodeScreenNode: ViewControllerTracingNode, ASScrollViewDeleg self.doneButton.title = self.presentationData.strings.Share_ShareMessage } - //TODO:localize self.scanButton = SolidRoundedButtonNode(theme: SolidRoundedButtonTheme(backgroundColor: .clear, foregroundColor: self.presentationData.theme.actionSheet.controlAccentColor), font: .regular, height: 42.0, cornerRadius: 0.0, gloss: false) - self.scanButton.title = "Scan QR Code" + self.scanButton.title = presentationData.strings.PeerInfo_QRCode_Scan self.scanButton.icon = UIImage(bundleImageName: "Settings/ScanQr") self.listNode = ListView() diff --git a/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumModeComponent.swift b/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumModeComponent.swift index 4dceea5b90..7a1f095ce4 100644 --- a/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumModeComponent.swift +++ b/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumModeComponent.swift @@ -75,7 +75,7 @@ final class ForumModeComponent: Component { ItemComponent( theme: component.theme, animation: "ForumTabs", - title: "Tabs", + title: component.strings.PeerInfo_Topics_Tabs, isSelected: component.mode == .tabs ) ), @@ -104,7 +104,7 @@ final class ForumModeComponent: Component { ItemComponent( theme: component.theme, animation: "ForumList", - title: "List", + title: component.strings.PeerInfo_Topics_List, isSelected: component.mode == .list ) ), diff --git a/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumSettingsScreen.swift b/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumSettingsScreen.swift index 05194370d6..524a291a23 100644 --- a/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumSettingsScreen.swift +++ b/submodules/TelegramUI/Components/ForumSettingsScreen/Sources/ForumSettingsScreen.swift @@ -153,7 +153,7 @@ final class ForumSettingsScreenComponent: Component { if case .legacyGroup = peer { let context = component.context let signal: Signal = context.engine.peers.convertGroupToSupergroup(peerId: peer.id, additionalProcessing: { upgradedPeerId -> Signal in - return context.engine.peers.setChannelForumMode(id: upgradedPeerId, isForum: true, displayForumAsTabs: false) + return context.engine.peers.setChannelForumMode(id: upgradedPeerId, isForum: true, displayForumAsTabs: displayForumAsTabs) }) |> map(Optional.init) |> `catch` { [weak self] error -> Signal in @@ -244,11 +244,10 @@ final class ForumSettingsScreenComponent: Component { let presentationData = component.context.sharedContext.currentPresentationData.with { $0 } - //TODO:localize let navigationTitleSize = self.navigationTitle.update( transition: transition, component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: "Topics", font: Font.semibold(17.0), textColor: environment.theme.rootController.navigationBar.primaryTextColor)), + text: .plain(NSAttributedString(string: environment.strings.PeerInfo_Topics_Title, font: Font.semibold(17.0), textColor: environment.theme.rootController.navigationBar.primaryTextColor)), horizontalAlignment: .center )), environment: {}, @@ -293,7 +292,7 @@ final class ForumSettingsScreenComponent: Component { contentHeight += 124.0 - let subtitleString = NSMutableAttributedString(attributedString: parseMarkdownIntoAttributedString("The group chat will be divided into topics created by admins or users.", attributes: MarkdownAttributes( + let subtitleString = NSMutableAttributedString(attributedString: parseMarkdownIntoAttributedString(environment.strings.PeerInfo_Topics_EnableTopicsInfo, attributes: MarkdownAttributes( body: MarkdownAttributeSet(font: Font.regular(15.0), textColor: environment.theme.list.freeTextColor), bold: MarkdownAttributeSet(font: Font.semibold(15.0), textColor: environment.theme.list.freeTextColor), link: MarkdownAttributeSet(font: Font.regular(15.0), textColor: environment.theme.list.itemAccentColor), @@ -344,7 +343,7 @@ final class ForumSettingsScreenComponent: Component { title: AnyComponent(VStack([ AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "Enable Topics", + string: environment.strings.PeerInfo_Topics_EnableTopics, font: Font.regular(presentationData.listsFontSize.baseDisplaySize), textColor: environment.theme.list.itemPrimaryTextColor )), @@ -389,7 +388,7 @@ final class ForumSettingsScreenComponent: Component { theme: environment.theme, header: AnyComponent(MultilineTextComponent( text: .plain(NSAttributedString( - string: "DISPLAY AS", + string: environment.strings.PeerInfo_Topics_DisplayAs, font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: environment.theme.list.freeTextColor )), @@ -397,7 +396,7 @@ final class ForumSettingsScreenComponent: Component { )), footer: AnyComponent(MultilineTextComponent( text: .markdown( - text: "Choose how topics appear for all members.", + text: environment.strings.PeerInfo_Topics_DisplayAsInfo, attributes: MarkdownAttributes( body: MarkdownAttributeSet(font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: environment.theme.list.freeTextColor), bold: MarkdownAttributeSet(font: Font.semibold(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: environment.theme.list.freeTextColor), diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 654f3dd354..4ea27126a0 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -2581,8 +2581,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt } if canSetupTopics { - //TODO:localize - let label = channel.flags.contains(.isForum) ? "Enabled" : "Disabled" + let label = channel.flags.contains(.isForum) ? presentationData.strings.PeerInfo_OptionTopics_Enabled : presentationData.strings.PeerInfo_OptionTopics_Disabled items[.peerDataSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemTopics, label: .text(label), text: presentationData.strings.PeerInfo_OptionTopics, icon: UIImage(bundleImageName: "Settings/Menu/Topics"), action: { if let topicsLimitedReason = topicsLimitedReason { interaction.displayTopicsLimited(topicsLimitedReason) @@ -2710,8 +2709,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt } if canSetupTopics { - //TODO:localize - items[.peerPublicSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemTopics, label: .text("Disabled"), text: presentationData.strings.PeerInfo_OptionTopics, icon: UIImage(bundleImageName: "Settings/Menu/Topics"), action: { + items[.peerPublicSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemTopics, label: .text(presentationData.strings.PeerInfo_OptionTopics_Disabled), text: presentationData.strings.PeerInfo_OptionTopics, icon: UIImage(bundleImageName: "Settings/Menu/Topics"), action: { if let topicsLimitedReason = topicsLimitedReason { interaction.displayTopicsLimited(topicsLimitedReason) } else { diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerMediaRecording.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerMediaRecording.swift index 22e9cf0160..49ba1bb019 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerMediaRecording.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerMediaRecording.swift @@ -505,11 +505,11 @@ extension ChatControllerImpl { self.present( textAlertController( context: self.context, - title: "Trim to selected range?", - text: "Audio outside that range will be discarded, and recording will start immediately.", + title: self.presentationData.strings.Chat_TrimVoiceMessageToResume_Title, + text: self.presentationData.strings.Chat_TrimVoiceMessageToResume_Text, actions: [ TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_Cancel, action: {}), - TextAlertAction(type: .defaultAction, title: "Proceed", action: { + TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Chat_TrimVoiceMessageToResume_Proceed, action: { proceed() }) ]