From f0e7e635f2103252b3d7627e90454c47c6986152 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 15 Mar 2017 11:39:47 -0300 Subject: [PATCH] Respond to CR. // FREEBIE --- .../view controllers/MessagesViewController.m | 25 ++++++++----------- .../translations/en.lproj/Localizable.strings | 18 ++++++++----- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index d718a5ddc..ec57dfa9c 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -1273,22 +1273,17 @@ typedef enum : NSUInteger { if (message.messageType == TSOutgoingMessageAdapter) { TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)message.interaction; if (outgoingMessage.messageState == TSOutgoingMessageStateUnsent) { - return [[NSAttributedString alloc] initWithString:NSLocalizedString(@"FAILED_SENDING_TEXT", nil)]; + return [[NSAttributedString alloc] initWithString:NSLocalizedString(@"MESSAGE_STATUS_FAILED", + @"message footer for failed messages")]; } else if (outgoingMessage.messageState == TSOutgoingMessageStateSent || outgoingMessage.messageState == TSOutgoingMessageStateDelivered) { - // Show a checkmark icon. - // - // TODO: It'd be nice to distinguish the "sent" and "delivered" states, - // but JSQMessageViewController doesn't give us a great way to do so. - // We don't have a great icon for the "delivered" state, - // we can't kern checkmarks together in a JSQMessageViewController - // "cell bottom label", etc. - NSAttributedString *result = - [[NSAttributedString alloc] initWithString:@"N" - attributes:@{ - NSFontAttributeName: [UIFont ows_elegantIconsFont:10.f], - }]; - + NSString *text = (outgoingMessage.messageState == TSOutgoingMessageStateSent + ? NSLocalizedString(@"MESSAGE_STATUS_SENT", + @"message footer for sent messages") + : NSLocalizedString(@"MESSAGE_STATUS_DELIVERED", + @"message footer for delivered messages")); + NSAttributedString *result = [[NSAttributedString alloc] initWithString:text]; + // Show when it's the last message in the thread if (indexPath.item == [self.collectionView numberOfItemsInSection:indexPath.section] - 1) { [self updateLastDeliveredMessage:message]; @@ -1304,7 +1299,7 @@ typedef enum : NSUInteger { return result; } } else if (message.isMediaBeingSent) { - return [[NSAttributedString alloc] initWithString:NSLocalizedString(@"UPLOADING_MESSAGE_TEXT", + return [[NSAttributedString alloc] initWithString:NSLocalizedString(@"MESSAGE_STATUS_UPLOADING", @"message footer while attachment is uploading")]; } else { OWSAssert(outgoingMessage.messageState == TSOutgoingMessageStateAttemptingOut); diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 9eaba0f3d..1c46c5a1f 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -337,9 +337,6 @@ /* action sheet header when re-sending message which failed because of untrusted identity keys */ "FAILED_SENDING_BECAUSE_UNTRUSTED_IDENTITY_KEY" = "You must accept the new safety number before you will be able to send."; -/* No comment provided by engineer. */ -"FAILED_SENDING_TEXT" = "Sending failed. Tap to retry."; - /* alert title */ "FAILED_VERIFICATION_TITLE" = "Failed to Verify Safety Number!"; @@ -493,6 +490,18 @@ /* No comment provided by engineer. */ "MESSAGE_COMPOSEVIEW_TITLE" = "New Message"; +/* message footer for delivered messages */ +"MESSAGE_STATUS_DELIVERED" = "Delivered"; + +/* message footer for failed messages */ +"MESSAGE_STATUS_FAILED" = "Sending failed. Tap to retry."; + +/* message footer for sent messages */ +"MESSAGE_STATUS_SENT" = "Sent"; + +/* message footer while attachment is uploading */ +"MESSAGE_STATUS_UPLOADING" = "Uploading..."; + /* The subtitle for the messages view title indicates that the title can be tapped to access settings for this conversation. */ "MESSAGES_VIEW_TITLE_SUBTITLE" = "Tap here for settings"; @@ -979,9 +988,6 @@ /* No comment provided by engineer. */ "Upgrading Signal ..." = "Upgrading Signal ..."; -/* message footer while attachment is uploading */ -"UPLOADING_MESSAGE_TEXT" = "Uploading..."; - /* button text for back button on verification view */ "VERIFICATION_BACK_BUTTON" = "Back";