Skip to content

Commit 9bcffd2

Browse files
aarifsumrathatswinnie
andauthoredMar 13, 2025
Localize FXIOS-9612 #21206 [FirefoxHomepage][shortcut] Localized Pinned Tiles for voice over accessibility (#25267)
Co-authored-by: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com>
1 parent aac61f7 commit 9bcffd2

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed
 

‎firefox-ios/Client/Frontend/Home/Homepage Rebuild/TopSites/TopSiteConfiguration.swift

+12-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@ struct TopSiteConfiguration: Hashable, Equatable {
1414
return .FirefoxHomepage.Shortcuts.Sponsored
1515
}
1616

17+
private var pinnedTitle: String {
18+
.localizedStringWithFormat(
19+
.FirefoxHomepage.Shortcuts.PinnedAccessibilityLabel,
20+
title
21+
)
22+
}
23+
24+
private var pinnedStatusTitle: String {
25+
return isPinned ? pinnedTitle : title
26+
}
27+
1728
var accessibilityLabel: String? {
18-
return isSponsored ? "\(title), \(sponsoredText)" : title
29+
return isSponsored ? "\(pinnedStatusTitle), \(sponsoredText)" : pinnedStatusTitle
1930
}
2031

2132
var isPinned: Bool {

‎firefox-ios/Client/Frontend/Home/TopSites/TopSite.swift

+12-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@ final class TopSite: FeatureFlaggable {
1414
return .FirefoxHomepage.Shortcuts.Sponsored
1515
}
1616

17+
private var pinnedTitle: String {
18+
.localizedStringWithFormat(
19+
.FirefoxHomepage.Shortcuts.PinnedAccessibilityLabel,
20+
title
21+
)
22+
}
23+
24+
private var pinnedStatusTitle: String {
25+
isPinned ? pinnedTitle : title
26+
}
27+
1728
var accessibilityLabel: String? {
18-
return isSponsored ? "\(title), \(sponsoredText)" : title
29+
return isSponsored ? "\(pinnedStatusTitle), \(sponsoredText)" : pinnedStatusTitle
1930
}
2031

2132
var isPinned: Bool {

‎firefox-ios/Shared/Strings.swift

+7
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,13 @@ extension String {
11721172
tableName: nil,
11731173
value: "Sponsored",
11741174
comment: "This string will show under a shortcuts tile on the firefox home page, indicating that the tile is a sponsored tile. Space is limited, please keep as short as possible.")
1175+
1176+
public static let PinnedAccessibilityLabel = MZLocalizedString(
1177+
key: "FirefoxHomepage.Shortcuts.Pinned.AccessibilityLabel.v139",
1178+
tableName: "FirefoxHomepage",
1179+
value: "Pinned: %@",
1180+
comment: "Accessibility label for shortcuts tile on the Firefox home page, indicating that the tile is a pinned tile. %@ is the title of the website."
1181+
)
11751182
}
11761183

11771184
public struct YourLibrary { }

‎firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class BrowsingPDFTests: BaseTestCase {
109109
// Open pdf from pinned site
110110
let pdfTopSite = app
111111
.collectionViews[AccessibilityIdentifiers.FirefoxHomepage.collectionView]
112-
.links[PDF_website["bookmarkLabel"]!]
112+
.links["Pinned: \(PDF_website["bookmarkLabel"]!)"]
113113
.children(matching: .other)
114114
.element
115115
.children(matching: .other)

‎firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ class PhotonActionSheetTests: BaseTestCase {
2323
let cell = itemCell.staticTexts["Example Domain"]
2424
mozWaitForElementToExist(cell)
2525
if #available(iOS 17, *) {
26-
mozWaitForElementToExist(app.links["Example Domain"].images[StandardImageIdentifiers.Small.pinBadgeFill])
26+
mozWaitForElementToExist(app.links["Pinned: Example Domain"].images[StandardImageIdentifiers.Small.pinBadgeFill])
2727
} else {
2828
// No identifier is available for iOS 17 amd below
29-
mozWaitForElementToExist(app.links["Example Domain"].images.element(boundBy: 1))
29+
mozWaitForElementToExist(app.links["Pinned: Example Domain"].images.element(boundBy: 1))
3030
}
3131

3232
// Remove pin

0 commit comments

Comments
 (0)
Failed to load comments.