Skip to content

Commit d45e58e

Browse files
author
Isaac
committed
Update localization
1 parent 817e189 commit d45e58e

File tree

9 files changed

+71
-43
lines changed

9 files changed

+71
-43
lines changed

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13164,3 +13164,40 @@ Sorry for the inconvenience.";
1316413164
"PeerInfo.BotBalance.Title" = "BALANCE";
1316513165
"PeerInfo.BotBalance.Ton" = "Ton";
1316613166
"PeerInfo.BotBalance.Stars" = "Stars";
13167+
13168+
"Gallery.ToastVideoSpeedSwipe" = "Swipe sideways to adjust speed.";
13169+
"Gallery.VideoSettings.QualitySectionTitle" = "QUALITY";
13170+
"Gallery.VideoSettings.SpeedSectionTitle" = "PLAYBACK SPEED";
13171+
"Gallery.VideoSettings.SpeedControlTitle" = "Speed";
13172+
13173+
"Gallery.VideoSettings.QualityAuto" = "Auto";
13174+
"Gallery.VideoSettings.QualityLow" = "Low";
13175+
"Gallery.VideoSettings.QualityMedium" = "Medium";
13176+
"Gallery.VideoSettings.QualityHD" = "High";
13177+
"Gallery.VideoSettings.QualityFHD" = "Full HD";
13178+
"Gallery.VideoSettings.QualityQHD" = "Ultra-High";
13179+
13180+
"Gallery.VideoSettings.IconQualityLow" = "L";
13181+
"Gallery.VideoSettings.IconQualityMedium" = "SD";
13182+
"Gallery.VideoSettings.IconQualityHD" = "HD";
13183+
"Gallery.VideoSettings.IconQualityFHD" = "FHD";
13184+
"Gallery.VideoSettings.IconQualityQHD" = "QHD";
13185+
13186+
"Gallery.MenuSaveToGallery" = "Save to Gallery";
13187+
"Gallery.SaveToGallery.Quality" = "Save in %@p";
13188+
"Gallery.SaveToGallery.Original" = "Save Original";
13189+
13190+
"VideoChat.ScheduleButtonTitle" = "Schedule Video Chat";
13191+
13192+
"Chat.ToastImprovingVideo.Title" = "Improving video...";
13193+
"Chat.ToastImprovingVideo.Text" = "The video will be published after it's optimized for the best viewing experience.";
13194+
"Chat.ToastVideoPublished.Title" = "Video Published";
13195+
"Chat.ToastVideoPublished.Action" = "View";
13196+
"Chat.MessageTooltipVideoProcessing" = "Processing video may take a few minutes.";
13197+
13198+
"Chat.VideoProcessingServiceMessage_1" = "This video will be published once converted and optimized";
13199+
"Chat.VideoProcessingServiceMessage_any" = "These videos will be published once converted and optimized";
13200+
13201+
"Chat.ScheduledForceSendProcessingVideo.Title" = "Wait!";
13202+
"Chat.ScheduledForceSendProcessingVideo.Text" = "This video hasn't been converted and optimized yet. If you send it now, the viewers of the video may experience slow download speed.";
13203+
"Chat.ScheduledForceSendProcessingVideo.Action" = "Send Anyway";

submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,6 @@ final class SettingsHeaderButton: HighlightableButtonNode {
600600
self.dotLayer.bounds = CGRect(origin: CGPoint(), size: dotFrame.size)
601601
}
602602
}
603-
604-
//self.setBadges(speed: "1.5x", quality: "HD", transition: .immediate)
605603
}
606604

607605
override func didLoad() {
@@ -1619,12 +1617,11 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
16191617
activeEdgeRateIndicatorTransition = .immediate
16201618
}
16211619

1622-
//TODO:localize
16231620
let activeEdgeRateIndicatorSize = activeEdgeRateIndicator.update(
16241621
transition: ComponentTransition(activeEdgeRateIndicatorTransition),
16251622
component: AnyComponent(GalleryRateToastComponent(
16261623
rate: activeEdgeRateState.currentRate,
1627-
displayTooltip: "Swipe sideways to adjust speed."
1624+
displayTooltip: self.presentationData.strings.Gallery_ToastVideoSpeedSwipe
16281625
)),
16291626
environment: {},
16301627
containerSize: CGSize(width: layout.size.width - layout.safeInsets.left * 2.0, height: 100.0)
@@ -1902,15 +1899,15 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
19021899
var qualityString: String?
19031900
if case let .quality(quality) = videoQuality {
19041901
if quality <= 360 {
1905-
qualityString = "SD"
1902+
qualityString = self.presentationData.strings.Gallery_VideoSettings_IconQualityLow
19061903
} else if quality <= 480 {
1907-
qualityString = "SD"
1904+
qualityString = self.presentationData.strings.Gallery_VideoSettings_IconQualityMedium
19081905
} else if quality <= 720 {
1909-
qualityString = "HD"
1906+
qualityString = self.presentationData.strings.Gallery_VideoSettings_IconQualityHD
19101907
} else if quality <= 1080 {
1911-
qualityString = "FHD"
1908+
qualityString = self.presentationData.strings.Gallery_VideoSettings_IconQualityFHD
19121909
} else {
1913-
qualityString = "UHD"
1910+
qualityString = self.presentationData.strings.Gallery_VideoSettings_IconQualityQHD
19141911
}
19151912
}
19161913

@@ -3474,7 +3471,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
34743471

34753472
if isSettings {
34763473
let sliderValuePromise = ValuePromise<Double?>(nil)
3477-
topItems.append(.custom(SliderContextItem(title: "Speed", minValue: 0.2, maxValue: 2.5, value: status.baseRate, valueChanged: { [weak self] newValue, _ in
3474+
topItems.append(.custom(SliderContextItem(title: strongSelf.presentationData.strings.Gallery_VideoSettings_SpeedControlTitle, minValue: 0.2, maxValue: 2.5, value: status.baseRate, valueChanged: { [weak self] newValue, _ in
34783475
guard let strongSelf = self, let videoNode = strongSelf.videoNode else {
34793476
return
34803477
}
@@ -3488,7 +3485,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
34883485

34893486
if let videoQualityState = strongSelf.videoNode?.videoQualityState(), !videoQualityState.available.isEmpty {
34903487
} else {
3491-
items.append(.custom(SectionTitleContextItem(text: "PLAYBACK SPEED"), false))
3488+
items.append(.custom(SectionTitleContextItem(text: strongSelf.presentationData.strings.Gallery_VideoSettings_SpeedSectionTitle), false))
34923489
for (text, _, rate) in strongSelf.speedList(strings: strongSelf.presentationData.strings) {
34933490
let isSelected = abs(status.baseRate - rate) < 0.01
34943491
items.append(.action(ContextMenuActionItem(text: text, icon: { _ in return nil }, iconSource: ContextMenuActionItemIconSource(size: CGSize(width: 24.0, height: 24.0), signal: sliderValuePromise.get()
@@ -3514,12 +3511,11 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35143511
}
35153512

35163513
if let videoQualityState = strongSelf.videoNode?.videoQualityState(), !videoQualityState.available.isEmpty {
3517-
items.append(.custom(SectionTitleContextItem(text: "VIDEO QUALITY"), false))
3514+
items.append(.custom(SectionTitleContextItem(text: strongSelf.presentationData.strings.Gallery_VideoSettings_QualitySectionTitle), false))
35183515

3519-
//TODO:localize
35203516
do {
35213517
let isSelected = videoQualityState.preferred == .auto
3522-
let qualityText: String = "Auto"
3518+
let qualityText: String = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityAuto
35233519
let textLayout: ContextMenuActionItemTextLayout
35243520
if videoQualityState.current != 0 {
35253521
textLayout = .secondLineWithValue("\(videoQualityState.current)p")
@@ -3551,15 +3547,15 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35513547
let isSelected = videoQualityState.preferred == .quality(quality)
35523548
let qualityTitle: String
35533549
if quality <= 360 {
3554-
qualityTitle = "Low"
3550+
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityLow
35553551
} else if quality <= 480 {
3556-
qualityTitle = "Medium"
3552+
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityMedium
35573553
} else if quality <= 720 {
3558-
qualityTitle = "High"
3554+
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityHD
35593555
} else if quality <= 1080 {
3560-
qualityTitle = "Full HD"
3556+
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityFHD
35613557
} else {
3562-
qualityTitle = "Ultra HD"
3558+
qualityTitle = strongSelf.presentationData.strings.Gallery_VideoSettings_QualityQHD
35633559
}
35643560
items.append(.action(ContextMenuActionItem(text: qualityTitle, textLayout: .secondLineWithValue("\(quality)p"), icon: { _ in
35653561
if isSelected {
@@ -3584,7 +3580,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
35843580
}
35853581
} else {
35863582
if let (message, maybeFile, _) = strongSelf.contentInfo(), let file = maybeFile, !message.isCopyProtected() && !item.peerIsCopyProtected && message.paidContent == nil {
3587-
items.append(.action(ContextMenuActionItem(text: "Save to Gallery", icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Download"), color: theme.actionSheet.primaryTextColor) }, action: { c, _ in
3583+
items.append(.action(ContextMenuActionItem(text: strongSelf.presentationData.strings.Gallery_MenuSaveToGallery, icon: { theme in generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Download"), color: theme.actionSheet.primaryTextColor) }, action: { c, _ in
35883584
guard let self else {
35893585
c?.dismiss(result: .default, completion: nil)
35903586
return
@@ -3616,9 +3612,9 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
36163612
let fileSizeString = dataSizeString(qualityFileSize, formatting: DataSizeStringFormatting(presentationData: self.presentationData))
36173613
let title: String
36183614
if let quality {
3619-
title = "Save in \(quality)p"
3615+
title = self.presentationData.strings.Gallery_SaveToGallery_Quality("\(quality)").string
36203616
} else {
3621-
title = "Save Original"
3617+
title = self.presentationData.strings.Gallery_SaveToGallery_Original
36223618
}
36233619
items.append(.action(ContextMenuActionItem(text: title, textLayout: .secondLineWithValue(fileSizeString), icon: { _ in
36243620
return nil

submodules/TelegramCallsUI/Sources/ScheduleVideoChatSheetScreen.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ private final class ScheduleVideoChatSheetContentComponent: Component {
110110
var contentHeight: CGFloat = 0.0
111111
contentHeight += 16.0
112112

113-
//TODO:localize
114113
let titleString = NSMutableAttributedString()
115-
titleString.append(NSAttributedString(string: "Schedule Video Chat", font: Font.semibold(17.0), textColor: environment.theme.list.itemPrimaryTextColor))
114+
titleString.append(NSAttributedString(string: environment.strings.VideoChat_ScheduleButtonTitle, font: Font.semibold(17.0), textColor: environment.theme.list.itemPrimaryTextColor))
116115

117116
let titleSize = self.title.update(
118117
transition: .immediate,
@@ -272,7 +271,7 @@ private final class ScheduleVideoChatSheetContentComponent: Component {
272271
pressedColor: UIColor(rgb: 0x2B2B2F).withMultipliedAlpha(0.8)
273272
),
274273
content: AnyComponentWithIdentity(id: AnyHashable(0 as Int), component: AnyComponent(
275-
Text(text: "Cancel", font: Font.semibold(17.0), color: environment.theme.list.itemPrimaryTextColor)
274+
Text(text: environment.strings.Common_Cancel, font: Font.semibold(17.0), color: environment.theme.list.itemPrimaryTextColor)
276275
)),
277276
isEnabled: true,
278277
tintWhenDisabled: false,

submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4603,15 +4603,14 @@ extension ChatControllerImpl {
46034603
c?.displayProcessingVideoTooltip(messageId: firstEvent.id)
46044604
}
46054605

4606-
//TODO:localize
46074606
c.present(
46084607
UndoOverlayController(
46094608
presentationData: self.presentationData,
46104609
content: .universalImage(
46114610
image: generateTintedImage(image: UIImage(bundleImageName: "Chat/ToastImprovingVideo"), color: .white)!,
46124611
size: nil,
4613-
title: "Improving video...",
4614-
text: "The video will be published after it's optimized for the bese viewing experience.",
4612+
title: self.presentationData.strings.Chat_ToastImprovingVideo_Title,
4613+
text: self.presentationData.strings.Chat_ToastImprovingVideo_Text,
46154614
customUndoText: nil,
46164615
timeout: 5.0
46174616
),

submodules/TelegramUI/Sources/Chat/ChatControllerToasts.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extension ChatControllerImpl {
6161
context: self.context,
6262
file: .message(message: MessageReference(message._asMessage()), media: file),
6363
title: nil,
64-
text: "Video Published",
64+
text: self.presentationData.strings.Chat_ToastVideoPublished_Title,
6565
undoText: nil,
6666
customAction: nil
6767
),
@@ -74,15 +74,14 @@ extension ChatControllerImpl {
7474
self.dismiss()
7575
}
7676
} else {
77-
//TODO:localize
7877
self.controllerInteraction?.presentControllerInCurrent(UndoOverlayController(
7978
presentationData: self.presentationData,
8079
content: .media(
8180
context: self.context,
8281
file: .message(message: MessageReference(message._asMessage()), media: file),
8382
title: nil,
84-
text: "Video Published",
85-
undoText: "View",
83+
text: self.presentationData.strings.Chat_ToastVideoPublished_Title,
84+
undoText: self.presentationData.strings.Chat_ToastVideoPublished_Action,
8685
customAction: { [weak self] in
8786
guard let self else {
8887
return

submodules/TelegramUI/Sources/ChatController.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10357,8 +10357,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
1035710357
let bounds = statusNode.view.convert(statusNode.view.bounds, to: self.chatDisplayNode.view)
1035810358
let location = CGPoint(x: bounds.midX, y: bounds.minY - 8.0)
1035910359

10360-
//TODO:localize
10361-
let tooltipController = TooltipController(content: .text("Processing video may take a few minutes."), baseFontSize: self.presentationData.listsFontSize.baseDisplaySize, balancedTextLayout: true, isBlurred: true, timeout: 4.5, dismissByTapOutside: true, dismissImmediatelyOnLayoutUpdate: true)
10360+
let tooltipController = TooltipController(content: .text(self.presentationData.strings.Chat_MessageTooltipVideoProcessing), baseFontSize: self.presentationData.listsFontSize.baseDisplaySize, balancedTextLayout: true, isBlurred: true, timeout: 4.5, dismissByTapOutside: true, dismissImmediatelyOnLayoutUpdate: true)
1036210361
self.checksTooltipController = tooltipController
1036310362
tooltipController.dismissed = { [weak self, weak tooltipController] _ in
1036410363
if let strongSelf = self, let tooltipController = tooltipController, strongSelf.checksTooltipController === tooltipController {

submodules/TelegramUI/Sources/ChatHistoryEntriesForView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ func chatHistoryEntriesForView(
297297
}
298298

299299
let insertPendingProcessingMessage: ([Message], Int) -> Void = { messages, index in
300-
//TODO:localize
301300
let serviceMessage = Message(
302301
stableId: UInt32.max - messages[0].stableId,
303302
stableVersion: 0,
@@ -316,7 +315,7 @@ func chatHistoryEntriesForView(
316315
author: nil,
317316
text: "",
318317
attributes: [],
319-
media: [TelegramMediaAction(action: .customText(text: "This video will be published once converted and optimized", entities: [], additionalAttributes: nil))],
318+
media: [TelegramMediaAction(action: .customText(text: presentationData.strings.Chat_VideoProcessingServiceMessage(Int32(messages.count)), entities: [], additionalAttributes: nil))],
320319
peers: SimpleDictionary<PeerId, Peer>(),
321320
associatedMessages: SimpleDictionary<MessageId, Message>(),
322321
associatedMessageIds: [],

submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,13 +1145,12 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
11451145
c?.dismiss(completion: {
11461146
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
11471147

1148-
//TODO:localize
11491148
controllerInteraction.presentController(standardTextAlertController(
11501149
theme: AlertControllerTheme(presentationData: presentationData),
1151-
title: "Wait!",
1152-
text: "This video hasn't been converted and optimized yet. If you send it now, the viewers of the video may experience slow download speed.",
1150+
title: presentationData.strings.Chat_ScheduledForceSendProcessingVideo_Title,
1151+
text: presentationData.strings.Chat_ScheduledForceSendProcessingVideo_Text,
11531152
actions: [
1154-
TextAlertAction(type: .defaultAction, title: "Send Anyway", action: {
1153+
TextAlertAction(type: .defaultAction, title: presentationData.strings.Chat_ScheduledForceSendProcessingVideo_Action, action: {
11551154
controllerInteraction.sendScheduledMessagesNow(selectAll ? messages.map { $0.id } : [message.id])
11561155
}),
11571156
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {})
@@ -2864,7 +2863,9 @@ private final class ChatReadReportContextItemNode: ASDisplayNode, ContextMenuCus
28642863
})
28652864
}
28662865

2867-
item.context.account.viewTracker.updateReactionsForMessageIds(messageIds: [item.message.id], force: true)
2866+
if !self.item.isEdit {
2867+
item.context.account.viewTracker.updateReactionsForMessageIds(messageIds: [item.message.id], force: true)
2868+
}
28682869
}
28692870

28702871
deinit {
@@ -3131,7 +3132,7 @@ private final class ChatReadReportContextItemNode: ASDisplayNode, ContextMenuCus
31313132
let placeholderAvatarsContent: AnimatedAvatarSetContext.Content
31323133

31333134
var avatarsPeers: [EnginePeer] = []
3134-
if self.item.message.id.peerId.namespace == Namespaces.Peer.CloudUser {
3135+
if self.item.message.id.peerId.namespace == Namespaces.Peer.CloudUser || self.item.isEdit {
31353136
} else if let recentPeers = self.item.message.reactionsAttribute?.recentPeers, !recentPeers.isEmpty {
31363137
for recentPeer in recentPeers {
31373138
if let peer = self.item.message.peers[recentPeer.peerId] {

0 commit comments

Comments
 (0)