Refactor string generation

This commit is contained in:
Ali
2021-07-20 11:57:50 +02:00
parent bbd096d88b
commit 7bed1728bb
205 changed files with 15848 additions and 33988 deletions

View File

@@ -85,21 +85,21 @@ final class ChatListInputActivitiesNode: ASDisplayNode {
let peerTitle = activities[0].0.compactDisplayTitle
switch activities[0].1 {
case .uploadingVideo:
text = strings.DialogList_SingleUploadingVideoSuffix(peerTitle).0
text = strings.DialogList_SingleUploadingVideoSuffix(peerTitle).string
case .uploadingInstantVideo:
text = strings.DialogList_SingleUploadingVideoSuffix(peerTitle).0
text = strings.DialogList_SingleUploadingVideoSuffix(peerTitle).string
case .uploadingPhoto:
text = strings.DialogList_SingleUploadingPhotoSuffix(peerTitle).0
text = strings.DialogList_SingleUploadingPhotoSuffix(peerTitle).string
case .uploadingFile:
text = strings.DialogList_SingleUploadingFileSuffix(peerTitle).0
text = strings.DialogList_SingleUploadingFileSuffix(peerTitle).string
case .recordingVoice:
text = strings.DialogList_SingleRecordingAudioSuffix(peerTitle).0
text = strings.DialogList_SingleRecordingAudioSuffix(peerTitle).string
case .recordingInstantVideo:
text = strings.DialogList_SingleRecordingVideoMessageSuffix(peerTitle).0
text = strings.DialogList_SingleRecordingVideoMessageSuffix(peerTitle).string
case .playingGame:
text = strings.DialogList_SinglePlayingGameSuffix(peerTitle).0
text = strings.DialogList_SinglePlayingGameSuffix(peerTitle).string
case .typingText:
text = strings.DialogList_SingleTypingSuffix(peerTitle).0
text = strings.DialogList_SingleTypingSuffix(peerTitle).string
case .speakingInGroupCall:
text = ""
}
@@ -129,12 +129,12 @@ final class ChatListInputActivitiesNode: ASDisplayNode {
let peerTitle = activities[0].0.compactDisplayTitle
if activities.count == 2 {
let secondPeerTitle = activities[1].0.compactDisplayTitle
string = NSAttributedString(string: strings.DialogList_MultipleTypingPair(peerTitle, secondPeerTitle).0, font: textFont, textColor: color)
string = NSAttributedString(string: strings.DialogList_MultipleTypingPair(peerTitle, secondPeerTitle).string, font: textFont, textColor: color)
} else {
string = NSAttributedString(string: strings.DialogList_MultipleTyping(peerTitle, strings.DialogList_MultipleTypingSuffix(activities.count - 1).0).0, font: textFont, textColor: color)
string = NSAttributedString(string: strings.DialogList_MultipleTyping(peerTitle, strings.DialogList_MultipleTypingSuffix(activities.count - 1).string).string, font: textFont, textColor: color)
}
} else {
string = NSAttributedString(string: strings.DialogList_MultipleTypingSuffix(activities.count).0, font: textFont, textColor: color)
string = NSAttributedString(string: strings.DialogList_MultipleTypingSuffix(activities.count).string, font: textFont, textColor: color)
}
state = .typingText(string, lightColor)
}