@ -97,7 +97,25 @@ class SignalAttachment: NSObject {
assert(false)
returnnil
}
return"\(error)"
switcherror{
case.missingData:
returnNSLocalizedString("ATTACHMENT_ERROR_MISSING_DATA",comment:"Attachment error message for attachments without any data")
case.fileSizeTooLarge:
returnNSLocalizedString("ATTACHMENT_ERROR_FILE_SIZE_TOO_LARGE",comment:"Attachment error message for attachments whose data exceed file size limits")
case.invalidData:
returnNSLocalizedString("ATTACHMENT_ERROR_INVALID_DATA",comment:"Attachment error message for attachments with invalid data")
case.couldNotParseImage:
returnNSLocalizedString("ATTACHMENT_ERROR_COULD_NOT_PARSE_IMAGE",comment:"Attachment error message for image attachments which cannot be parsed")
case.couldNotConvertToJpeg:
returnNSLocalizedString("ATTACHMENT_ERROR_COULD_NOT_CONVERT_TO_JPEG",comment:"Attachment error message for image attachments which could not be converted to JPEG")
case.invalidFileFormat:
returnNSLocalizedString("ATTACHMENT_ERROR_INVALID_FILE_FORMAT",comment:"Attachment error message for attachments with an invalid file format")
}
}
classvarmissingDataErrorMessage:String{
returnNSLocalizedString("ATTACHMENT_ERROR_MISSING_DATA",comment:"Attachment error message for attachments without any data")
/* Attachment error message for image attachments which could not be converted to JPEG */
"ATTACHMENT_ERROR_COULD_NOT_CONVERT_TO_JPEG" = "Image attachment could not be resized.";
/* Attachment error message for image attachments which cannot be parsed */
"ATTACHMENT_ERROR_COULD_NOT_PARSE_IMAGE" = "Image attachment could not be parsed.";
/* Attachment error message for attachments whose data exceed file size limits */
"ATTACHMENT_ERROR_FILE_SIZE_TOO_LARGE" = "Attachment is too large.";
/* Attachment error message for attachments with invalid data */
"ATTACHMENT_ERROR_INVALID_DATA" = "Attachment has invalid contents.";
/* Attachment error message for attachments with an invalid file format */
"ATTACHMENT_ERROR_INVALID_FILE_FORMAT" = "Attachment has invalid file format.";
/* Attachment error message for attachments without any data */
"ATTACHMENT_ERROR_MISSING_DATA" = "Attachment is empty.";
/* Accessibility hint describing what you can do with the attachment button */
"ATTACHMENT_HINT" = "Choose or take a picture and then send it";
@ -79,9 +100,6 @@
/* No comment provided by engineer. */
"AUDIO_PERMISSION_MESSAGE" = "Signal requires access to your microphone to work properly. You can grant this permission in the Settings app >> Privacy >> Microphone >> Signal";