Skip to content

Commit

Permalink
Add accessibility label for underlined annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak committed Aug 9, 2024
1 parent 5779ed0 commit f4baf08
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Zotero/Assets/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
"pdf.deleted_message" = "This document has been deleted. Do you want to restore it?";
"pdf.line_width_point" = "%0.1f pt";
"pdf.highlight" = "Highlight";
"pdf.underline" = "Underline";
"pdf.annotation_share.image.share" = "Share image";
"pdf.annotation_share.image.medium" = "Medium";
"pdf.annotation_share.image.large" = "Large";
Expand Down Expand Up @@ -562,6 +563,7 @@
"accessibility.pdf.share_annotation_image" = "Share annotation image";
"accessibility.pdf.eraser_annotation" = "Eraser";
"accessibility.pdf.highlighted_text" = "Highlighted text";
"accessibility.pdf.underlined_text" = "Underlined text";
"accessibility.pdf.author" = "Author";
"accessibility.pdf.comment" = "Comment";
"accessibility.pdf.tags" = "Tags";
Expand Down
4 changes: 4 additions & 0 deletions Zotero/Extensions/Localizable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ internal enum L10n {
internal static let underlineAnnotation = L10n.tr("Localizable", "accessibility.pdf.underline_annotation", fallback: "Underline annotation")
/// Create underline annotation
internal static let underlineAnnotationTool = L10n.tr("Localizable", "accessibility.pdf.underline_annotation_tool", fallback: "Create underline annotation")
/// Underlined text
internal static let underlinedText = L10n.tr("Localizable", "accessibility.pdf.underlined_text", fallback: "Underlined text")
/// Undo
internal static let undo = L10n.tr("Localizable", "accessibility.pdf.undo", fallback: "Undo")
}
Expand Down Expand Up @@ -947,6 +949,8 @@ internal enum L10n {
internal static let previousPage = L10n.tr("Localizable", "pdf.previous_page", fallback: "Previous Page")
/// Previous Viewport
internal static let previousViewport = L10n.tr("Localizable", "pdf.previous_viewport", fallback: "Previous Viewport")
/// Underline
internal static let underline = L10n.tr("Localizable", "pdf.underline", fallback: "Underline")
internal enum AnnotationPopover {
/// Delete Annotation
internal static let delete = L10n.tr("Localizable", "pdf.annotation_popover.delete", fallback: "Delete Annotation")
Expand Down
11 changes: 10 additions & 1 deletion Zotero/Scenes/Detail/PDF/Views/AnnotationCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,16 @@ final class AnnotationCell: UITableViewCell {
let author = isAuthor ? nil : authorName
var label = accessibilityLabel(for: type, pageLabel: pageLabel, author: author)
if let text {
label += ", " + L10n.Accessibility.Pdf.highlightedText + ": " + text
switch type {
case .highlight:
label += ", " + L10n.Accessibility.Pdf.highlightedText + ": " + text

case .underline:
label += ", " + L10n.Accessibility.Pdf.underlinedText + ": " + text

case .note, .image, .ink, .freeText:
break
}
}
if !selected {
if !comment.isEmpty {
Expand Down

0 comments on commit f4baf08

Please sign in to comment.