Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin 2019-09-04 01:59:46 +03:00
commit 97eca304f8
13 changed files with 3449 additions and 3441 deletions

View file

@ -243,6 +243,7 @@
"Common.Search" = "Search";
"Common.More" = "More";
"Common.Select" = "Select";
"Items.NOfM" = "%1$@ of %2$@";
// State
"State.Connecting" = "Connecting...";
@ -309,6 +310,7 @@
"LastSeen.HoursAgo_0" = "last seen %@ hours ago";
"LastSeen.YesterdayAt" = "last seen yesterday at %@";
"LastSeen.AtDate" = "last seen %@";
"LastSeen.TodayAt" = "last seen today at %@";
"LastSeen.Lately" = "last seen recently";
"LastSeen.WithinAWeek" = "last seen within a week";
"LastSeen.WithinAMonth" = "last seen within a month";

View file

@ -39,7 +39,7 @@ class ChatDocumentGalleryItem: GalleryItem {
}
if let location = self.location {
node._title.set(.single("\(location.index + 1) \(self.presentationData.strings.Common_of) \(location.count)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.index + 1)", "\(location.count)").0))
}
node.setMessage(self.message)
@ -48,7 +48,7 @@ class ChatDocumentGalleryItem: GalleryItem {
func updateNode(node: GalleryItemNode) {
if let node = node as? ChatDocumentGalleryItemNode, let location = self.location {
node._title.set(.single("\(location.index + 1) \(self.presentationData.strings.Common_of) \(location.count)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.index + 1)", "\(location.count)").0))
node.setMessage(self.message)
}
}

View file

@ -40,7 +40,7 @@ class ChatExternalFileGalleryItem: GalleryItem {
}
if let location = self.location {
node._title.set(.single("\(location.index + 1) \(self.presentationData.strings.Common_of) \(location.count)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.index + 1)", "\(location.count)").0))
}
node.setMessage(self.message)
@ -49,7 +49,7 @@ class ChatExternalFileGalleryItem: GalleryItem {
func updateNode(node: GalleryItemNode) {
if let node = node as? ChatExternalFileGalleryItemNode, let location = self.location {
node._title.set(.single("\(location.index + 1) \(self.presentationData.strings.Common_of) \(location.count)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.index + 1)", "\(location.count)").0))
node.setMessage(self.message)
}
}

View file

@ -112,7 +112,7 @@ class ChatImageGalleryItem: GalleryItem {
}
if let location = self.location {
node._title.set(.single("\(location.index + 1) \(self.presentationData.strings.Common_of) \(location.count)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.index + 1)", "\(location.count)").0))
}
node.setMessage(self.message)
@ -122,7 +122,7 @@ class ChatImageGalleryItem: GalleryItem {
func updateNode(node: GalleryItemNode) {
if let node = node as? ChatImageGalleryItemNode, let location = self.location {
node._title.set(.single("\(location.index + 1) \(self.presentationData.strings.Common_of) \(location.count)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.index + 1)", "\(location.count)").0))
node.setMessage(self.message)
}

View file

@ -55,7 +55,7 @@ public class UniversalVideoGalleryItem: GalleryItem {
let node = UniversalVideoGalleryItemNode(context: self.context, presentationData: self.presentationData, performAction: self.performAction, openActionOptions: self.openActionOptions)
if let indexData = self.indexData {
node._title.set(.single("\(indexData.position + 1) \(self.presentationData.strings.Common_of) \(indexData.totalCount)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(indexData.position + 1)", "\(indexData.totalCount)").0))
}
node.setupItem(self)
@ -66,7 +66,7 @@ public class UniversalVideoGalleryItem: GalleryItem {
public func updateNode(node: GalleryItemNode) {
if let node = node as? UniversalVideoGalleryItemNode {
if let indexData = self.indexData {
node._title.set(.single("\(indexData.position + 1) \(self.presentationData.strings.Common_of) \(indexData.totalCount)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(indexData.position + 1)", "\(indexData.totalCount)").0))
}
node.setupItem(self)

View file

@ -60,7 +60,7 @@ class InstantImageGalleryItem: GalleryItem {
node.setImage(imageReference: self.imageReference)
if let location = self.location {
node._title.set(.single("\(location.position + 1) \(self.presentationData.strings.Common_of) \(location.totalCount)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.position + 1)", "\(location.totalCount)").0))
}
node.setCaption(self.caption, credit: self.credit)
@ -71,7 +71,7 @@ class InstantImageGalleryItem: GalleryItem {
func updateNode(node: GalleryItemNode) {
if let node = node as? InstantImageGalleryItemNode {
if let location = self.location {
node._title.set(.single("\(location.position + 1) \(self.presentationData.strings.Common_of) \(location.totalCount)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(location.position + 1)", "\(location.totalCount)").0))
}
node.setCaption(self.caption, credit: self.credit)

View file

@ -36,7 +36,7 @@ class SecureIdDocumentGalleryItem: GalleryItem {
node.setResource(secureIdContext: self.secureIdContext, resource: self.resource)
node._title.set(.single("\(self.location.position + 1) \(self.strings.Common_of) \(self.location.totalCount)"))
node._title.set(.single(self.strings.Items_NOfM("\(self.location.position + 1)", "\(self.location.totalCount)").0))
node.setCaption(self.caption)
node.delete = self.delete
@ -46,7 +46,7 @@ class SecureIdDocumentGalleryItem: GalleryItem {
func updateNode(node: GalleryItemNode) {
if let node = node as? SecureIdDocumentGalleryItemNode {
node._title.set(.single("\(self.location.position + 1) \(self.strings.Common_of) \(self.location.totalCount)"))
node._title.set(.single(self.strings.Items_NOfM("\(self.location.position + 1)", "\(self.location.totalCount)").0))
node.setCaption(self.caption)
node.delete = self.delete

View file

@ -59,7 +59,7 @@ class PeerAvatarImageGalleryItem: GalleryItem {
let node = PeerAvatarImageGalleryItemNode(context: self.context, presentationData: self.presentationData, peer: self.peer)
if let indexData = self.entry.indexData {
node._title.set(.single("\(indexData.position + 1) \(self.presentationData.strings.Common_of) \(indexData.totalCount)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(indexData.position + 1)", "\(indexData.totalCount)").0))
}
node.setEntry(self.entry)
@ -71,7 +71,7 @@ class PeerAvatarImageGalleryItem: GalleryItem {
func updateNode(node: GalleryItemNode) {
if let node = node as? PeerAvatarImageGalleryItemNode {
if let indexData = self.entry.indexData {
node._title.set(.single("\(indexData.position + 1) \(self.presentationData.strings.Common_of) \(indexData.totalCount)"))
node._title.set(.single(self.presentationData.strings.Items_NOfM("\(indexData.position + 1)", "\(indexData.totalCount)").0))
}
node.setEntry(self.entry)

View file

@ -114,7 +114,7 @@ public func stringForUserPresence(strings: PresentationStrings, day: RelativeTim
let dayString: String
switch day {
case .today:
dayString = strings.LastSeen_AtDate(strings.Time_TodayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0).0
dayString = strings.LastSeen_TodayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
case .yesterday:
dayString = strings.LastSeen_YesterdayAt(stringForShortTimestamp(hours: hours, minutes: minutes, dateTimeFormat: dateTimeFormat)).0
}

View file

@ -520,7 +520,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
if let count = webpageGalleryMediaCount {
additionalImageBadgeContent = .text(inset: 0.0, backgroundColor: presentationData.theme.theme.chat.message.mediaDateAndStatusFillColor, foregroundColor: presentationData.theme.theme.chat.message.mediaDateAndStatusTextColor, text: NSAttributedString(string: "1 \(presentationData.strings.Common_of) \(count)"))
additionalImageBadgeContent = .text(inset: 0.0, backgroundColor: presentationData.theme.theme.chat.message.mediaDateAndStatusFillColor, foregroundColor: presentationData.theme.theme.chat.message.mediaDateAndStatusTextColor, text: NSAttributedString(string: presentationData.strings.Items_NOfM("1", "\(count)").0))
skipStandardStatus = imageMode
} else if let mediaBadge = mediaBadge {
additionalImageBadgeContent = .text(inset: 0.0, backgroundColor: presentationData.theme.theme.chat.message.mediaDateAndStatusFillColor, foregroundColor: presentationData.theme.theme.chat.message.mediaDateAndStatusTextColor, text: NSAttributedString(string: mediaBadge))

View file

@ -128,7 +128,7 @@ final class ChatSearchInputPanelNode: ChatInputPanelNode {
if let currentId = results.currentId, let index = results.messageIndices.firstIndex(where: { $0.id == currentId }) {
let adjustedIndex = results.messageIndices.count - 1 - index
resultIndex = index
resultsText = NSAttributedString(string: "\(adjustedIndex + 1) \(interfaceState.strings.Common_of) \(displayTotalCount)", font: labelFont, textColor: interfaceState.theme.chat.inputPanel.primaryTextColor)
resultsText = NSAttributedString(string: interfaceState.strings.Items_NOfM("\(adjustedIndex + 1)", "\(displayTotalCount)").0, font: labelFont, textColor: interfaceState.theme.chat.inputPanel.primaryTextColor)
} else {
resultsText = NSAttributedString(string: interfaceState.strings.Conversation_SearchNoResults, font: labelFont, textColor: interfaceState.theme.chat.inputPanel.primaryTextColor)
}