mirror of
https://github.com/metabolist/metatext.git
synced 2025-02-17 14:35:13 +00:00
VoiceOver improvements
This commit is contained in:
parent
25bc782707
commit
d508df8bb1
5 changed files with 77 additions and 10 deletions
|
@ -18,10 +18,6 @@ extension Attachment.AttachmentType {
|
||||||
}
|
}
|
||||||
|
|
||||||
func accessibilityNames(count: Int) -> String {
|
func accessibilityNames(count: Int) -> String {
|
||||||
if count == 1 {
|
|
||||||
return accessibilityName
|
|
||||||
}
|
|
||||||
|
|
||||||
let format: String
|
let format: String
|
||||||
|
|
||||||
switch self {
|
switch self {
|
||||||
|
|
|
@ -58,13 +58,9 @@
|
||||||
"attachment.sensitive-content" = "Sensitive content";
|
"attachment.sensitive-content" = "Sensitive content";
|
||||||
"attachment.media-hidden" = "Media hidden";
|
"attachment.media-hidden" = "Media hidden";
|
||||||
"attachment.type.image" = "Image";
|
"attachment.type.image" = "Image";
|
||||||
"attachment.type.images-%ld" = "%ld images";
|
|
||||||
"attachment.type.audio" = "Audio file";
|
"attachment.type.audio" = "Audio file";
|
||||||
"attachment.type.audios-%ld" = "%ld audio files";
|
|
||||||
"attachment.type.video" = "Video";
|
"attachment.type.video" = "Video";
|
||||||
"attachment.type.videos-%ld" = "%ld videos";
|
|
||||||
"attachment.type.unknown" = "Attachment";
|
"attachment.type.unknown" = "Attachment";
|
||||||
"attachment.type.unknown-%ld" = "%ld attachments";
|
|
||||||
"attachment.unable-to-export-media" = "Unable to export media";
|
"attachment.unable-to-export-media" = "Unable to export media";
|
||||||
"bookmarks" = "Bookmarks";
|
"bookmarks" = "Bookmarks";
|
||||||
"card.link.accessibility-label" = "Link";
|
"card.link.accessibility-label" = "Link";
|
||||||
|
|
|
@ -98,5 +98,69 @@
|
||||||
<string>%ld Followers</string>
|
<string>%ld Followers</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>attachment.type.images-%ld</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringLocalizedFormatKey</key>
|
||||||
|
<string>%#@images@</string>
|
||||||
|
<key>images</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringFormatSpecTypeKey</key>
|
||||||
|
<string>NSStringPluralRuleType</string>
|
||||||
|
<key>NSStringFormatValueTypeKey</key>
|
||||||
|
<string>ld</string>
|
||||||
|
<key>one</key>
|
||||||
|
<string>%ld image</string>
|
||||||
|
<key>other</key>
|
||||||
|
<string>%ld images</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>attachment.type.audios-%ld</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringLocalizedFormatKey</key>
|
||||||
|
<string>%#@audios@</string>
|
||||||
|
<key>audios</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringFormatSpecTypeKey</key>
|
||||||
|
<string>NSStringPluralRuleType</string>
|
||||||
|
<key>NSStringFormatValueTypeKey</key>
|
||||||
|
<string>ld</string>
|
||||||
|
<key>one</key>
|
||||||
|
<string>%ld audio file</string>
|
||||||
|
<key>other</key>
|
||||||
|
<string>%ld audio files</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>attachment.type.videos-%ld</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringLocalizedFormatKey</key>
|
||||||
|
<string>%#@videos@</string>
|
||||||
|
<key>videos</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringFormatSpecTypeKey</key>
|
||||||
|
<string>NSStringPluralRuleType</string>
|
||||||
|
<key>NSStringFormatValueTypeKey</key>
|
||||||
|
<string>ld</string>
|
||||||
|
<key>one</key>
|
||||||
|
<string>%ld video file</string>
|
||||||
|
<key>other</key>
|
||||||
|
<string>%ld video files</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>attachment.type.unknowns-%ld</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringLocalizedFormatKey</key>
|
||||||
|
<string>%#@unknowns@</string>
|
||||||
|
<key>unknowns</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSStringFormatSpecTypeKey</key>
|
||||||
|
<string>NSStringPluralRuleType</string>
|
||||||
|
<key>NSStringFormatValueTypeKey</key>
|
||||||
|
<string>ld</string>
|
||||||
|
<key>one</key>
|
||||||
|
<string>%ld attachment</string>
|
||||||
|
<key>other</key>
|
||||||
|
<string>%ld attachments</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -82,7 +82,18 @@ final class AttachmentsView: UIView {
|
||||||
type = .unknown
|
type = .unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
accessibilityLabel = type.accessibilityNames(count: viewModel.attachmentViewModels.count)
|
var accessibilityLabel = type.accessibilityNames(count: viewModel.attachmentViewModels.count)
|
||||||
|
|
||||||
|
for attachmentViewModel in viewModel.attachmentViewModels {
|
||||||
|
guard let description = attachmentViewModel.attachment.description,
|
||||||
|
!description.isEmpty
|
||||||
|
else { continue }
|
||||||
|
|
||||||
|
accessibilityLabel.appendWithSeparator(attachmentViewModel.attachment.type.accessibilityName)
|
||||||
|
accessibilityLabel.appendWithSeparator(description)
|
||||||
|
}
|
||||||
|
|
||||||
|
self.accessibilityLabel = accessibilityLabel
|
||||||
} else {
|
} else {
|
||||||
accessibilityLabel = curtainButton.title(for: .normal)
|
accessibilityLabel = curtainButton.title(for: .normal)
|
||||||
}
|
}
|
||||||
|
|
|
@ -487,7 +487,7 @@ private extension StatusView {
|
||||||
displayNameLabel.attributedText = mutableDisplayName
|
displayNameLabel.attributedText = mutableDisplayName
|
||||||
accountLabel.text = viewModel.accountName
|
accountLabel.text = viewModel.accountName
|
||||||
|
|
||||||
let nameButtonAccessibilityAttributedLabel = mutableDisplayName
|
let nameButtonAccessibilityAttributedLabel = NSMutableAttributedString(attributedString: mutableDisplayName)
|
||||||
|
|
||||||
nameButtonAccessibilityAttributedLabel.appendWithSeparator(viewModel.accountName)
|
nameButtonAccessibilityAttributedLabel.appendWithSeparator(viewModel.accountName)
|
||||||
nameButton.accessibilityAttributedLabel = nameButtonAccessibilityAttributedLabel
|
nameButton.accessibilityAttributedLabel = nameButtonAccessibilityAttributedLabel
|
||||||
|
|
Loading…
Reference in a new issue