Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class PhotoCollectionsDataSource: NSObject, ObservableObject, PHPhotoLibr

private static func allSections() -> [PhotoCollectionSection] {
var sections = [
Self.section(title: AlbumsDataStrings.PhotoCollectionsDataSource.smartAlbumsHeader, types: [.library, .screenshots, .favorites]),
Self.section(title: Strings.PhotoCollectionsDataSource.smartAlbumsHeader, types: [.library, .screenshots, .favorites]),
]

if PHPhotoLibrary.authorizationStatus(for: .readWrite) == .authorized {
sections.append(Self.section(title: AlbumsDataStrings.PhotoCollectionsDataSource.userAlbumsHeader, types: [.userAlbum]))
sections.append(Self.section(title: Strings.PhotoCollectionsDataSource.userAlbumsHeader, types: [.userAlbum]))
}

return sections
Expand Down
2 changes: 1 addition & 1 deletion Modules/Capabilities/AlbumsUI/Sources/AlbumsList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct AlbumsList: View {
}
}
.listStyle(SidebarListStyle())
.navigationTitle(AlbumsUIStrings.AlbumsViewController.navigationTitle)
.navigationTitle(Strings.AlbumsViewController.navigationTitle)
.environmentObject(navigationWrapper)
.albumsListBackground()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AlbumsViewController: UIHostingController<AlbumsList>, NavigationWr
view.tintColor = .primaryDark

if let navigationObject {
navigationItem.title = AlbumsUIStrings.AlbumsViewController.navigationTitle
navigationItem.title = Strings.AlbumsViewController.navigationTitle
albumsList.navigationWrapper = NavigationWrapper(navigationObject: navigationObject)
self.rootView = albumsList
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AdditionTextLabel: UILabel {
init() {
super.init(frame: .zero)
font = .preferredFont(forTextStyle: .body)
text = DesktopAutoRedactionsUIStrings.AdditionTextLabel.text
text = Strings.AdditionTextLabel.text
translatesAutoresizingMaskIntoConstraints = false

setContentHuggingPriority(.required, for: .horizontal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CancelButton: UIButton {
setContentHuggingPriority(.required, for: .vertical)
translatesAutoresizingMaskIntoConstraints = false

setTitle(DesktopAutoRedactionsUIStrings.CancelButton.title, for: .normal)
setTitle(Strings.CancelButton.title, for: .normal)
addTarget(nil, action: #selector(AdditionViewController.cancel(_:)), for: .primaryActionTriggered)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SaveButton: UIButton {
setContentHuggingPriority(.required, for: .vertical)
translatesAutoresizingMaskIntoConstraints = false

setTitle(DesktopAutoRedactionsUIStrings.SaveButton.title, for: .normal)
setTitle(Strings.SaveButton.title, for: .normal)
addTarget(nil, action: #selector(AdditionViewController.saveWord), for: .primaryActionTriggered)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ListHeaderLabel: UILabel {
super.init(frame: .zero)

font = Self.labelFont
text = DesktopAutoRedactionsUIStrings.DesktopSettingsView.wordListLabel
text = Strings.DesktopSettingsView.wordListLabel
translatesAutoresizingMaskIntoConstraints = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DocumentScannerBarButtonItem: UIBarButtonItem {
target: self,
action: #selector(presentDocumentScanner(_:))
)
standard.accessibilityLabel = DocumentScanningStrings.DocumentScannerBarButtonItem.accessibilityLabel
standard.accessibilityLabel = Strings.DocumentScannerBarButtonItem.accessibilityLabel
return standard
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ import DesignSystem

@MainActor class PageCountAlertFactory: NSObject {
static func alert(completionHandler: @escaping (@MainActor () -> Void)) -> UIAlertController {
let alertController = UIAlertController(title: Strings.alertTitle, message: Strings.alertMessage, preferredStyle: .alert)
let alertController = UIAlertController(
title: Strings.PageCountAlertFactory.alertTitle,
message: Strings.PageCountAlertFactory.alertMessage,
preferredStyle: .alert
)
alertController.view.tintColor = .controlTint
alertController.addAction(UIAlertAction(title: Strings.dismissButtonTitle, style: .default) { _ in
completionHandler()
})

let dismissAction = UIAlertAction(
title: Strings.PageCountAlertFactory.dismissButtonTitle,
style: .default,
handler: { _ in completionHandler() }
)
alertController.addAction(dismissAction)

return alertController
}

typealias Strings = DocumentScanningStrings.PageCountAlertFactory
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ColorPickerBarButtonItem: UIBarButtonItem {
self.init(customView: ColorWell(target: target, color: color))

UIView.appearance(whenContainedInInstancesOf: [UIColorPickerViewController.self]).overrideUserInterfaceStyle = .dark
accessibilityLabel = EditingToolbarStrings.ColorPickerBarButtonItem.accessibilityLabel
accessibilityLabel = Strings.ColorPickerBarButtonItem.accessibilityLabel
accessibilityValue = color.accessibilityName
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import UIKit
class DebugPreferencesBarButtonItem: UIBarButtonItem {
convenience init(target: AnyObject?) {
self.init(image: UIImage(systemName: "ladybug"), style: .plain, target: target, action: #selector(ActionsBuilderActions.showDebugPreferences(_:)))
accessibilityLabel = EditingToolbarStrings.DebugPreferencesBarButtonItem.accessibilityLabel
accessibilityLabel = Strings.DebugPreferencesBarButtonItem.accessibilityLabel
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DismissBarButtonItem: UIBarButtonItem {
self.asset = asset
super.init()
self.style = .done
self.title = EditingToolbarStrings.DismissBarButtonItem.title
self.title = Strings.DismissBarButtonItem.title
self.target = self
self.action = #selector(handleButton)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ class HighlighterToolBarButtonItem: UIBarButtonItem {

private static func title(for tool: HighlighterTool) -> String {
switch tool {
case .magic: return Strings.magicToolItem
case .lasso: return Strings.lassoToolItem
case .manual: return Strings.manualToolItem
case .eraser: return Strings.eraserToolItem
case .magic: return Strings.HighlighterToolBarButtonItem.magicToolItem
case .lasso: return Strings.HighlighterToolBarButtonItem.lassoToolItem
case .manual: return Strings.HighlighterToolBarButtonItem.manualToolItem
case .eraser: return Strings.HighlighterToolBarButtonItem.eraserToolItem
}
}

private static let buttonTitle = Strings.buttonTitle

private typealias Strings = EditingToolbarStrings.HighlighterToolBarButtonItem
private static let buttonTitle = Strings.HighlighterToolBarButtonItem.buttonTitle
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import UIKit
class QuickRedactBarButtonItem: UIBarButtonItem {
convenience init(target: AnyObject?) {
self.init(image: UIImage(systemName: "gear"), style: .plain, target: target, action: #selector(ActionsBuilderActions.showAutoRedactAccess(_:)))
accessibilityLabel = EditingToolbarStrings.QuickRedactBarButtonItem.accessibilityLabel
accessibilityLabel = Strings.QuickRedactBarButtonItem.accessibilityLabel
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import UIKit
class SeekBarButtonItem: UIBarButtonItem {
convenience init(target: AnyObject?) {
self.init(image: Icons.seekAndDestroy, style: .plain, target: target, action: #selector(ActionsBuilderActions.startSeeking(_:)))
accessibilityLabel = EditingToolbarStrings.SeekBarButtonItem.accessibilityLabel
accessibilityLabel = Strings.SeekBarButtonItem.accessibilityLabel
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ struct DebugPreferencesBarButtonItemTests {
#expect(item.style == .plain)
#expect(item.target === target)
#expect(item.action == #selector(ActionsBuilderActions.showDebugPreferences(_:)))
#expect(item.accessibilityLabel == EditingToolbarStrings.DebugPreferencesBarButtonItem.accessibilityLabel)
#expect(item.accessibilityLabel == EditingToolbar.Strings.DebugPreferencesBarButtonItem.accessibilityLabel)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Testing

@MainActor
struct HighlighterToolBarButtonItemTests {
private typealias Strings = EditingToolbarStrings.HighlighterToolBarButtonItem
private typealias Strings = EditingToolbar.Strings.HighlighterToolBarButtonItem

@Test(arguments: [
HighlighterTool.magic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ExportingPreparer: NSObject {
let exportedImage = try await Rendering.renderer
.render(image: image, redactions: redactions)

let representedURLName = "\(ExportingStrings.PhotoEditingExporter.defaultImageName).\(imageType.preferredFilenameExtension ?? "png")"
let representedURLName = "\(Strings.PhotoEditingExporter.defaultImageName).\(imageType.preferredFilenameExtension ?? "png")"
let temporaryURL = URL(fileURLWithPath: NSTemporaryDirectory())
.appendingPathComponent(representedURLName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import UIKit
public enum PhotoExportErrorAlertFactory {
public static func alert(for error: Error) -> UIAlertController {
let alert = UIAlertController(
title: ExportingStrings.PhotoExportErrorAlertFactory.title,
message: ExportingStrings.PhotoExportErrorAlertFactory.messageFormat(error.localizedDescription),
title: Strings.PhotoExportErrorAlertFactory.title,
message: Strings.PhotoExportErrorAlertFactory.messageFormat(error.localizedDescription),
preferredStyle: .alert
)
alert.addAction(
UIAlertAction(title: ExportingStrings.PhotoExportErrorAlertFactory.dismissButtonTitle, style: .default)
UIAlertAction(title: Strings.PhotoExportErrorAlertFactory.dismissButtonTitle, style: .default)
)
alert.view.tintColor = .controlTint
return alert
Expand Down
2 changes: 1 addition & 1 deletion Modules/Capabilities/Exporting/Sources/SaveActivity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SaveActivity: UIActivity {
}

override var activityTitle: String? {
ExportingStrings.SaveActivity.title
Strings.SaveActivity.title
}

override var activityImage: UIImage? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ErrorHandling

class SaveCopyActivity: UIActivity {
override var activityTitle: String? {
ExportingStrings.SaveCopyActivity.title
Strings.SaveCopyActivity.title
}

override var activityImage: UIImage? {
Expand Down
10 changes: 4 additions & 6 deletions Modules/Capabilities/IntroView/Sources/IntroView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ public struct IntroView: View {

public var body: some View {
VStack(alignment: .leading, spacing: 3) {
IntroLabel(Strings.permissionLabelText)
IntroButton(Strings.permissionButtonTitle, action: permissionAction)
IntroLabel(Strings.IntroView.permissionLabelText)
IntroButton(Strings.IntroView.permissionButtonTitle, action: permissionAction)

IntroLabel(Strings.importLabelText).padding(.top, 12)
IntroButton(Strings.importButtonTitle, action: importAction)
IntroLabel(Strings.IntroView.importLabelText).padding(.top, 12)
IntroButton(Strings.IntroView.importButtonTitle, action: importAction)
}.background(Color.appPrimary).frame(maxWidth: 240)
}

// MARK: Boilerplate

private let permissionAction: (() -> Void)
private let importAction: (() -> Void)

private typealias Strings = IntroViewStrings.IntroView
}
14 changes: 6 additions & 8 deletions Modules/Capabilities/IntroView/Tests/IntroViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct IntroViewTests {
@Test
func permissionLabel() throws {
let introView = try IntroView().inspect()
_ = try introView.find(IntroLabel.self, containing: Strings.permissionLabelText)
_ = try introView.find(IntroLabel.self, containing: Strings.IntroView.permissionLabelText)
}

@Test
Expand All @@ -21,16 +21,16 @@ struct IntroViewTests {
let introView = try IntroView(
permissionAction: { buttonTapped() }
).inspect()
let button = try introView.find(IntroButton.self, containing: Strings.permissionButtonTitle)
let internalButton = try button.find(button: Strings.permissionButtonTitle)
let button = try introView.find(IntroButton.self, containing: Strings.IntroView.permissionButtonTitle)
let internalButton = try button.find(button: Strings.IntroView.permissionButtonTitle)
try internalButton.tap()
}
}

@Test
func importLabel() throws {
let introView = try IntroView().inspect()
_ = try introView.find(IntroLabel.self, containing: Strings.importLabelText)
_ = try introView.find(IntroLabel.self, containing: Strings.IntroView.importLabelText)
}

@Test
Expand All @@ -39,8 +39,8 @@ struct IntroViewTests {
let introView = try IntroView(
importAction: { buttonTapped() }
).inspect()
let button = try introView.find(IntroButton.self, containing: Strings.importButtonTitle)
let internalButton = try button.find(button: Strings.importButtonTitle)
let button = try introView.find(IntroButton.self, containing: Strings.IntroView.importButtonTitle)
let internalButton = try button.find(button: Strings.IntroView.importButtonTitle)
try internalButton.tap()
}
}
Expand All @@ -52,6 +52,4 @@ struct IntroViewTests {
let (_, _, maxWidth, _, _, _, _) = try vStack.flexFrame()
#expect(maxWidth == 240)
}

private typealias Strings = IntroViewStrings.IntroView
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ struct ReviewButton: View {
UIApplication.shared.open(URL(staticString: "https://itunes.apple.com/us/app/appName/id1215283742?mt=8&action=write-review"))
} label: {
ButtonLabel(
title: Strings.appStoreTitle,
subtitle: Strings.appStoreSubtitle,
title: Strings.SettingsContentContactSection.appStoreTitle,
subtitle: Strings.SettingsContentContactSection.appStoreSubtitle,
asset: MobileSettingsUIAsset.appStore
)
}
.settingsCell()
}

private typealias Strings = MobileSettingsUIStrings.SettingsContentContactSection
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct SettingsContentContactSection: View {
}

var body: some View {
Section(header: SettingsSectionHeader(Strings.header)) {
Section(header: SettingsSectionHeader(Strings.SettingsContentContactSection.header)) {
MailButton()
ReviewButton()
BlueskyURLButton()
Expand All @@ -24,6 +24,4 @@ struct SettingsContentContactSection: View {
let versionString = infoDictionary?["CFBundleShortVersionString"] as? String
return versionString ?? "???"
}

private typealias Strings = MobileSettingsUIStrings.SettingsContentContactSection
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ struct SettingsContentInformationSection: View {
return versionString ?? "???"
}

private typealias Strings = MobileSettingsUIStrings.SettingsContentInformationSection
private typealias Strings = MobileSettingsUI.Strings.SettingsContentInformationSection
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SwiftUI

struct SettingsContentOtherAppsSection: View {
var body: some View {
Section(header: SettingsSectionHeader(MobileSettingsUIStrings.SettingsContentOtherAppsSection.header)) {
Section(header: SettingsSectionHeader(Strings.SettingsContentOtherAppsSection.header)) {
OtherAppButton(
name: "Barc",
subtitle: "Save and store loyalty cards",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ struct SettingsContentPurchasedFeaturesSection: View {
}
}

private typealias Strings = MobileSettingsUIStrings.SettingsContentPurchasedFeaturesSection
private typealias Strings = MobileSettingsUI.Strings.SettingsContentPurchasedFeaturesSection
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct DoneButton: View {
}

var body: some View {
Button(MobileSettingsUIStrings.DoneButton.label, action: action)
Button(Strings.DoneButton.label, action: action)
.foregroundColor(.white)
.font(Font.navigationBarButtonFont)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ struct MailButton: View {
// the URL to open to send e-mail
private static let whatHaveYouDone = URL(staticString: "mailto:hello@cocoatype.com")

private typealias Strings = MobileSettingsUIStrings.SettingsContentContactSection
private typealias Strings = MobileSettingsUI.Strings.SettingsContentContactSection
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public struct SettingsView: View {
SettingsList(dismissAction: dismissAction) {
SettingsContent(state: purchaseState)
}
.navigationTitle(MobileSettingsUIStrings.SettingsViewController.navigationTitle)
.navigationTitle(Strings.SettingsViewController.navigationTitle)
.navigationBarTitleDisplayMode(.inline)
}
.environment(\.readableWidth, readableWidth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct PurchaseSubtitle: View {
return Strings.withProduct(displayPrice)
}

private typealias Strings = MobileSettingsUIStrings.PurchaseSubtitle
private typealias Strings = MobileSettingsUI.Strings.PurchaseSubtitle
}

#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SwiftUI

struct PurchaseTitle: View {
var body: some View {
return Text(MobileSettingsUIStrings.PurchaseItem.title)
return Text(Strings.PurchaseItem.title)
.font(.app(textStyle: .title3))
.foregroundColor(.white)
}
Expand Down
Loading