This commit is contained in:
Josh Soref 2022-11-30 20:09:36 -05:00 committed by GitHub
commit d94a7a3fe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 26 additions and 26 deletions

View file

@ -11,7 +11,7 @@ enum IdentitiesSection: Hashable {
enum IdentitiesItem: Hashable { enum IdentitiesItem: Hashable {
case add case add
case identitiy(Identity) case identity(Identity)
} }
final class IdentitiesDataSource: UITableViewDiffableDataSource<IdentitiesSection, IdentitiesItem> { final class IdentitiesDataSource: UITableViewDiffableDataSource<IdentitiesSection, IdentitiesItem> {
@ -39,7 +39,7 @@ final class IdentitiesDataSource: UITableViewDiffableDataSource<IdentitiesSectio
configuration.text = NSLocalizedString("add", comment: "") configuration.text = NSLocalizedString("add", comment: "")
configuration.image = UIImage(systemName: "plus.circle.fill") configuration.image = UIImage(systemName: "plus.circle.fill")
cell.contentConfiguration = configuration cell.contentConfiguration = configuration
case let .identitiy(identity): case let .identity(identity):
let viewModel = viewModelProvider(identity) let viewModel = viewModelProvider(identity)
(cell as? IdentityTableViewCell)?.viewModel = viewModel (cell as? IdentityTableViewCell)?.viewModel = viewModel
@ -83,11 +83,11 @@ private extension IdentitiesDataSource {
var newSnapshot = NSDiffableDataSourceSnapshot<IdentitiesSection, IdentitiesItem>() var newSnapshot = NSDiffableDataSourceSnapshot<IdentitiesSection, IdentitiesItem>()
let sections = [ let sections = [
(section: IdentitiesSection.identities(NSLocalizedString("identities.accounts", comment: "")), (section: IdentitiesSection.identities(NSLocalizedString("identities.accounts", comment: "")),
identities: identities.filter { $0.authenticated && !$0.pending }.map(IdentitiesItem.identitiy)), identities: identities.filter { $0.authenticated && !$0.pending }.map(IdentitiesItem.identity)),
(section: IdentitiesSection.identities(NSLocalizedString("identities.browsing", comment: "")), (section: IdentitiesSection.identities(NSLocalizedString("identities.browsing", comment: "")),
identities: identities.filter { !$0.authenticated && !$0.pending }.map(IdentitiesItem.identitiy)), identities: identities.filter { !$0.authenticated && !$0.pending }.map(IdentitiesItem.identity)),
(section: IdentitiesSection.identities(NSLocalizedString("identities.pending", comment: "")), (section: IdentitiesSection.identities(NSLocalizedString("identities.pending", comment: "")),
identities: identities.filter { $0.pending }.map(IdentitiesItem.identitiy)) identities: identities.filter { $0.pending }.map(IdentitiesItem.identity))
] ]
.filter { !$0.identities.isEmpty } .filter { !$0.identities.isEmpty }
@ -107,7 +107,7 @@ private extension IdentitiesItem {
switch self { switch self {
case .add: case .add:
return String(describing: UITableViewCell.self) return String(describing: UITableViewCell.self)
case .identitiy: case .identity:
return String(describing: IdentityTableViewCell.self) return String(describing: IdentityTableViewCell.self)
} }
} }

View file

@ -36,8 +36,8 @@ extension SystemEmoji.Group {
return "emoji.system-group.food-and-drink" return "emoji.system-group.food-and-drink"
case .travelAndPlaces: case .travelAndPlaces:
return "emoji.system-group.travel-and-places" return "emoji.system-group.travel-and-places"
case .activites: case .activities:
return "emoji.system-group.activites" return "emoji.system-group.activities"
case .objects: case .objects:
return "emoji.system-group.objects" return "emoji.system-group.objects"
case .symbols: case .symbols:

View file

@ -117,7 +117,7 @@
"compose.emoji-button" = "Emoji picker"; "compose.emoji-button" = "Emoji picker";
"compose.mark-media-sensitive" = "Mark media as sensitive"; "compose.mark-media-sensitive" = "Mark media as sensitive";
"compose.photo-library" = "Photo Library"; "compose.photo-library" = "Photo Library";
"compose.poll.accessibility.multiple-choices-allowed" = "Mutliple choices allowed"; "compose.poll.accessibility.multiple-choices-allowed" = "Multiple choices allowed";
"compose.poll.add-choice" = "Add a choice"; "compose.poll.add-choice" = "Add a choice";
"compose.poll.allow-multiple-choices" = "Allow multiple choices"; "compose.poll.allow-multiple-choices" = "Allow multiple choices";
"compose.poll-button.accessibility-label" = "Add a poll"; "compose.poll-button.accessibility-label" = "Add a poll";
@ -139,7 +139,7 @@
"emoji.system-group.animals-and-nature" = "Animals & Nature"; "emoji.system-group.animals-and-nature" = "Animals & Nature";
"emoji.system-group.food-and-drink" = "Food & Drink"; "emoji.system-group.food-and-drink" = "Food & Drink";
"emoji.system-group.travel-and-places" = "Travel & Places"; "emoji.system-group.travel-and-places" = "Travel & Places";
"emoji.system-group.activites" = "Activities"; "emoji.system-group.activities" = "Activities";
"emoji.system-group.objects" = "Objects"; "emoji.system-group.objects" = "Objects";
"emoji.system-group.symbols" = "Symbols"; "emoji.system-group.symbols" = "Symbols";
"emoji.system-group.flags" = "Flags"; "emoji.system-group.flags" = "Flags";
@ -222,7 +222,7 @@
"preferences.media.autoplay.wifi" = "On Wi-Fi"; "preferences.media.autoplay.wifi" = "On Wi-Fi";
"preferences.media.autoplay.never" = "Never"; "preferences.media.autoplay.never" = "Never";
"preferences.use-preferences-from-server" = "Use preferences from server"; "preferences.use-preferences-from-server" = "Use preferences from server";
"preferences.posting-default-visiblility" = "Default visibility"; "preferences.posting-default-visibility" = "Default visibility";
"preferences.posting-default-sensitive" = "Mark content sensitive by default"; "preferences.posting-default-sensitive" = "Mark content sensitive by default";
"preferences.reading-expand-media" = "Expand media"; "preferences.reading-expand-media" = "Expand media";
"preferences.expand-media.default" = "Hide sensitive"; "preferences.expand-media.default" = "Hide sensitive";
@ -332,9 +332,9 @@
"status.favorite-button.accessibility-label" = "Favorite"; "status.favorite-button.accessibility-label" = "Favorite";
"status.favorite-button.undo.accessibility-label" = "Unfavorite"; "status.favorite-button.undo.accessibility-label" = "Unfavorite";
"status.show-more" = "Show More"; "status.show-more" = "Show More";
"status.show-more-all-button.accessibilty-label" = "Show more for all"; "status.show-more-all-button.accessibility-label" = "Show more for all";
"status.show-less" = "Show Less"; "status.show-less" = "Show Less";
"status.show-less-all-button.accessibilty-label" = "Show less for all"; "status.show-less-all-button.accessibility-label" = "Show less for all";
"status.show-thread" = "Show thread"; "status.show-thread" = "Show thread";
"status.spoiler-text-placeholder" = "Write your warning here"; "status.spoiler-text-placeholder" = "Write your warning here";
"status.unbookmark" = "Unbookmark"; "status.unbookmark" = "Unbookmark";

View file

@ -31,7 +31,7 @@ public extension SystemEmoji {
case animalsAndNature case animalsAndNature
case foodAndDrink case foodAndDrink
case travelAndPlaces case travelAndPlaces
case activites case activities
case objects case objects
case symbols case symbols
case flags case flags

View file

@ -107,9 +107,9 @@ final class ZoomDismissalInteractionController: NSObject {
let totalAvailableAlpha = startingAlpha - finalAlpha let totalAvailableAlpha = startingAlpha - finalAlpha
let maximumDelta = view.bounds.height / 4.0 let maximumDelta = view.bounds.height / 4.0
let deltaAsPercentageOfMaximun = min(abs(verticalDelta) / maximumDelta, 1.0) let deltaAsPercentageOfMaximum = min(abs(verticalDelta) / maximumDelta, 1.0)
return startingAlpha - (deltaAsPercentageOfMaximun * totalAvailableAlpha) return startingAlpha - (deltaAsPercentageOfMaximum * totalAvailableAlpha)
} }
func scaleFor(view: UIView, withPanningVerticalDelta verticalDelta: CGFloat) -> CGFloat { func scaleFor(view: UIView, withPanningVerticalDelta verticalDelta: CGFloat) -> CGFloat {
@ -118,9 +118,9 @@ final class ZoomDismissalInteractionController: NSObject {
let totalAvailableScale = startingScale - finalScale let totalAvailableScale = startingScale - finalScale
let maximumDelta = view.bounds.height / 2.0 let maximumDelta = view.bounds.height / 2.0
let deltaAsPercentageOfMaximun = min(abs(verticalDelta) / maximumDelta, 1.0) let deltaAsPercentageOfMaximum = min(abs(verticalDelta) / maximumDelta, 1.0)
return startingScale - (deltaAsPercentageOfMaximun * totalAvailableScale) return startingScale - (deltaAsPercentageOfMaximum * totalAvailableScale)
} }
} }

View file

@ -37,7 +37,7 @@ final class IdentitiesViewController: UITableViewController {
} }
override func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool { override func tableView(_ tableView: UITableView, shouldHighlightRowAt indexPath: IndexPath) -> Bool {
if case let .identitiy(identityViewModel) = dataSource.itemIdentifier(for: indexPath) { if case let .identity(identityViewModel) = dataSource.itemIdentifier(for: indexPath) {
return identityViewModel.id != viewModel.identityContext.identity.id return identityViewModel.id != viewModel.identityContext.identity.id
} }
@ -55,7 +55,7 @@ final class IdentitiesViewController: UITableViewController {
let addIdentityViewController = UIHostingController(rootView: addIdentityView) let addIdentityViewController = UIHostingController(rootView: addIdentityView)
show(addIdentityViewController, sender: self) show(addIdentityViewController, sender: self)
case let .identitiy(identityViewModel): case let .identity(identityViewModel):
rootViewModel.identitySelected(id: identityViewModel.id) rootViewModel.identitySelected(id: identityViewModel.id)
} }
} }
@ -68,7 +68,7 @@ final class IdentitiesViewController: UITableViewController {
let logOutAction = UIContextualAction( let logOutAction = UIContextualAction(
style: .destructive, style: .destructive,
title: NSLocalizedString("identities.log-out", comment: "")) { [weak self] _, _, completionHandler in title: NSLocalizedString("identities.log-out", comment: "")) { [weak self] _, _, completionHandler in
guard let self = self, case let .identitiy(identity) = self.dataSource.itemIdentifier(for: indexPath) else { guard let self = self, case let .identity(identity) = self.dataSource.itemIdentifier(for: indexPath) else {
completionHandler(false) completionHandler(false)
return return

View file

@ -192,12 +192,12 @@ class TableViewController: UITableViewController {
navigationItem.rightBarButtonItem = nil navigationItem.rightBarButtonItem = nil
case .expand: case .expand:
navigationItem.rightBarButtonItem = UIBarButtonItem( navigationItem.rightBarButtonItem = UIBarButtonItem(
title: NSLocalizedString("status.show-more-all-button.accessibilty-label", comment: ""), title: NSLocalizedString("status.show-more-all-button.accessibility-label", comment: ""),
image: UIImage(systemName: "eye"), image: UIImage(systemName: "eye"),
primaryAction: UIAction { [weak self] _ in self?.viewModel.toggleExpandAll() }) primaryAction: UIAction { [weak self] _ in self?.viewModel.toggleExpandAll() })
case .collapse: case .collapse:
navigationItem.rightBarButtonItem = UIBarButtonItem( navigationItem.rightBarButtonItem = UIBarButtonItem(
title: NSLocalizedString("status.show-less-all-button.accessibilty-label", comment: ""), title: NSLocalizedString("status.show-less-all-button.accessibility-label", comment: ""),
image: UIImage(systemName: "eye.slash"), image: UIImage(systemName: "eye.slash"),
primaryAction: UIAction { [weak self] _ in self?.viewModel.toggleExpandAll() }) primaryAction: UIAction { [weak self] _ in self?.viewModel.toggleExpandAll() })
} }

View file

@ -37,7 +37,7 @@ extension Date {
if if
let oneWeekAgo = calendar.date(byAdding: DateComponents(weekOfMonth: -1), to: now), let oneWeekAgo = calendar.date(byAdding: DateComponents(weekOfMonth: -1), to: now),
oneWeekAgo < self { oneWeekAgo < self {
return Self.realtiveTimeFormatter.localizedString(for: self, relativeTo: Date()) return Self.relativeTimeFormatter.localizedString(for: self, relativeTo: Date())
} }
return Self.accessibilityFullDateComponentsFormatter.string(from: self) return Self.accessibilityFullDateComponentsFormatter.string(from: self)
@ -92,7 +92,7 @@ private extension Date {
return dateFormatter return dateFormatter
}() }()
private static let realtiveTimeFormatter: RelativeDateTimeFormatter = { private static let relativeTimeFormatter: RelativeDateTimeFormatter = {
let dateFormatter = RelativeDateTimeFormatter() let dateFormatter = RelativeDateTimeFormatter()
dateFormatter.unitsStyle = .full dateFormatter.unitsStyle = .full

View file

@ -42,7 +42,7 @@ struct PreferencesView: View {
Toggle("preferences.use-preferences-from-server", Toggle("preferences.use-preferences-from-server",
isOn: $viewModel.preferences.useServerPostingReadingPreferences) isOn: $viewModel.preferences.useServerPostingReadingPreferences)
Group { Group {
Picker("preferences.posting-default-visiblility", Picker("preferences.posting-default-visibility",
selection: $viewModel.preferences.postingDefaultVisibility) { selection: $viewModel.preferences.postingDefaultVisibility) {
Text("status.visibility.public").tag(Status.Visibility.public) Text("status.visibility.public").tag(Status.Visibility.public)
Text("status.visibility.unlisted").tag(Status.Visibility.unlisted) Text("status.visibility.unlisted").tag(Status.Visibility.unlisted)