chore: rename toot

This commit is contained in:
CMK 2021-03-15 13:42:46 +08:00
parent 92a26b2f73
commit 8c48bce627
12 changed files with 52 additions and 53 deletions

View File

@ -15,9 +15,9 @@
"title": "Vote Failure",
"poll_expired": "The poll has expired"
},
"discard_compose_content": {
"title": "Discard Toot",
"message": "Confirm discard composed toot content."
"discard_post_content": {
"title": "Discard Publish",
"message": "Confirm discard composed post content."
}
},
"controls": {
@ -41,7 +41,7 @@
"open_in_safari": "Open in Safari"
},
"status": {
"user_boosted": "%s boosted",
"user_reblogged": "%s reblogged",
"show_post": "Show Post",
"status_content_warning": "content warning",
"media_content_warning": "Tap to reveal that may be sensitive",
@ -76,17 +76,17 @@
},
"server_picker": {
"title": "Pick a Server,\nany server.",
"Button": {
"Category": {
"button": {
"category": {
"All": "All"
},
"SeeLess": "See Less",
"SeeMore": "See More"
"see_less": "See Less",
"see_more": "See More"
},
"Label": {
"Language": "LANGUAGE",
"Users": "USERS",
"Category": "CATEGORY"
"label": {
"language": "LANGUAGE",
"users": "USERS",
"category": "CATEGORY"
},
"input": {
"placeholder": "Find a server or join your own..."
@ -181,11 +181,11 @@
},
"compose": {
"title": {
"new_toot": "New Toot",
"new_post": "New Post",
"new_reply": "New Reply"
},
"content_input_placeholder": "Type or paste what's on your mind",
"compose_action": "Toot"
"compose_action": "Publish"
}
}
}

View File

@ -18,8 +18,8 @@ enum ComposeStatusSection: Equatable, Hashable {
extension ComposeStatusSection {
enum ComposeKind {
case toot
case replyToot(tootObjectID: NSManagedObjectID)
case post
case reply(repliedToStatusObjectID: NSManagedObjectID)
}
}
@ -33,7 +33,7 @@ extension ComposeStatusSection {
) -> UITableViewDiffableDataSource<ComposeStatusSection, ComposeStatusItem> {
UITableViewDiffableDataSource<ComposeStatusSection, ComposeStatusItem>(tableView: tableView) { [weak textEditorViewTextAttributesDelegate] tableView, indexPath, item -> UITableViewCell? in
switch item {
case .replyTo(let tootObjectID):
case .replyTo(let repliedToStatusObjectID):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ComposeRepliedToTootContentTableViewCell.self), for: indexPath) as! ComposeRepliedToTootContentTableViewCell
// TODO:
return cell

View File

@ -91,7 +91,7 @@ extension StatusSection {
cell.statusView.headerInfoLabel.text = {
let author = toot.author
let name = author.displayName.isEmpty ? author.username : author.displayName
return L10n.Common.Controls.Status.userBoosted(name)
return L10n.Common.Controls.Status.userReblogged(name)
}()
// set name username avatar

View File

@ -19,11 +19,11 @@ internal enum L10n {
/// Please try again later.
internal static let pleaseTryAgainLater = L10n.tr("Localizable", "Common.Alerts.Common.PleaseTryAgainLater")
}
internal enum DiscardComposeContent {
/// Confirm discard composed toot content.
internal static let message = L10n.tr("Localizable", "Common.Alerts.DiscardComposeContent.Message")
/// Discard Toot
internal static let title = L10n.tr("Localizable", "Common.Alerts.DiscardComposeContent.Title")
internal enum DiscardPostContent {
/// Confirm discard composed post content.
internal static let message = L10n.tr("Localizable", "Common.Alerts.DiscardPostContent.Message")
/// Discard Publish
internal static let title = L10n.tr("Localizable", "Common.Alerts.DiscardPostContent.Title")
}
internal enum ServerError {
/// Server Error
@ -84,9 +84,9 @@ internal enum L10n {
internal static let showPost = L10n.tr("Localizable", "Common.Controls.Status.ShowPost")
/// content warning
internal static let statusContentWarning = L10n.tr("Localizable", "Common.Controls.Status.StatusContentWarning")
/// %@ boosted
internal static func userBoosted(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Status.UserBoosted", String(describing: p1))
/// %@ reblogged
internal static func userReblogged(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Status.UserReblogged", String(describing: p1))
}
internal enum Poll {
/// Closed
@ -136,15 +136,15 @@ internal enum L10n {
internal enum Scene {
internal enum Compose {
/// Toot
/// Publish
internal static let composeAction = L10n.tr("Localizable", "Scene.Compose.ComposeAction")
/// Type or paste what's on your mind
internal static let contentInputPlaceholder = L10n.tr("Localizable", "Scene.Compose.ContentInputPlaceholder")
internal enum Title {
/// New Post
internal static let newPost = L10n.tr("Localizable", "Scene.Compose.Title.NewPost")
/// New Reply
internal static let newReply = L10n.tr("Localizable", "Scene.Compose.Title.NewReply")
/// New Toot
internal static let newToot = L10n.tr("Localizable", "Scene.Compose.Title.NewToot")
}
}
internal enum ConfirmEmail {
@ -290,9 +290,9 @@ internal enum L10n {
internal static let title = L10n.tr("Localizable", "Scene.ServerPicker.Title")
internal enum Button {
/// See Less
internal static let seeless = L10n.tr("Localizable", "Scene.ServerPicker.Button.Seeless")
internal static let seeLess = L10n.tr("Localizable", "Scene.ServerPicker.Button.SeeLess")
/// See More
internal static let seemore = L10n.tr("Localizable", "Scene.ServerPicker.Button.Seemore")
internal static let seeMore = L10n.tr("Localizable", "Scene.ServerPicker.Button.SeeMore")
internal enum Category {
/// All
internal static let all = L10n.tr("Localizable", "Scene.ServerPicker.Button.Category.All")

View File

@ -1,7 +1,7 @@
"Common.Alerts.Common.PleaseTryAgain" = "Please try again.";
"Common.Alerts.Common.PleaseTryAgainLater" = "Please try again later.";
"Common.Alerts.DiscardComposeContent.Message" = "Confirm discard composed toot content.";
"Common.Alerts.DiscardComposeContent.Title" = "Discard Toot";
"Common.Alerts.DiscardPostContent.Message" = "Confirm discard composed post content.";
"Common.Alerts.DiscardPostContent.Title" = "Discard Publish";
"Common.Alerts.ServerError.Title" = "Server Error";
"Common.Alerts.SignUpFailure.Title" = "Sign Up Failure";
"Common.Alerts.VoteFailure.PollExpired" = "The poll has expired";
@ -33,14 +33,14 @@
"Common.Controls.Status.Poll.VoterCount.Single" = "%d voter";
"Common.Controls.Status.ShowPost" = "Show Post";
"Common.Controls.Status.StatusContentWarning" = "content warning";
"Common.Controls.Status.UserBoosted" = "%@ boosted";
"Common.Controls.Status.UserReblogged" = "%@ reblogged";
"Common.Controls.Timeline.LoadMore" = "Load More";
"Common.Countable.Photo.Multiple" = "photos";
"Common.Countable.Photo.Single" = "photo";
"Scene.Compose.ComposeAction" = "Toot";
"Scene.Compose.ComposeAction" = "Publish";
"Scene.Compose.ContentInputPlaceholder" = "Type or paste what's on your mind";
"Scene.Compose.Title.NewPost" = "New Post";
"Scene.Compose.Title.NewReply" = "New Reply";
"Scene.Compose.Title.NewToot" = "New Toot";
"Scene.ConfirmEmail.Button.DontReceiveEmail" = "I never got an email";
"Scene.ConfirmEmail.Button.OpenEmailApp" = "Open Email App";
"Scene.ConfirmEmail.DontReceiveEmail.Description" = "Check if your email address is correct as well as your junk folder if you havent.";
@ -84,8 +84,8 @@ tap the link to confirm your account.";
"Scene.Register.Input.Username.Placeholder" = "username";
"Scene.Register.Title" = "Tell us about you.";
"Scene.ServerPicker.Button.Category.All" = "All";
"Scene.ServerPicker.Button.Seeless" = "See Less";
"Scene.ServerPicker.Button.Seemore" = "See More";
"Scene.ServerPicker.Button.SeeLess" = "See Less";
"Scene.ServerPicker.Button.SeeMore" = "See More";
"Scene.ServerPicker.EmptyState.BadNetwork" = "Something went wrong while loading data. Check your internet connection.";
"Scene.ServerPicker.EmptyState.FindingServers" = "Finding available servers...";
"Scene.ServerPicker.Input.Placeholder" = "Find a server or join your own...";

View File

@ -191,8 +191,8 @@ extension ComposeViewController {
private func showDismissConfirmAlertController() {
let alertController = UIAlertController(
title: L10n.Common.Alerts.DiscardComposeContent.title,
message: L10n.Common.Alerts.DiscardComposeContent.message,
title: L10n.Common.Alerts.DiscardPostContent.title,
message: L10n.Common.Alerts.DiscardPostContent.message,
preferredStyle: .alert
)
let discardAction = UIAlertAction(title: L10n.Common.Controls.Actions.discard, style: .destructive) { [weak self] _ in
@ -227,7 +227,6 @@ extension ComposeViewController: TextEditorViewTextAttributesDelegate {
updateAttributedString attributedString: NSAttributedString,
completion: @escaping (NSAttributedString?) -> Void
) {
DispatchQueue.global().async {
let string = attributedString.string
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: update: %s", ((#file as NSString).lastPathComponent), #line, #function, string)

View File

@ -26,10 +26,10 @@ extension ComposeViewModel {
var snapshot = NSDiffableDataSourceSnapshot<ComposeStatusSection, ComposeStatusItem>()
snapshot.appendSections([.repliedTo, .status])
switch composeKind {
case .replyToot(let tootObjectID):
case .reply(let tootObjectID):
snapshot.appendItems([.replyTo(tootObjectID: tootObjectID)], toSection: .repliedTo)
snapshot.appendItems([.toot(replyToTootObjectID: tootObjectID, attribute: composeTootAttribute)], toSection: .status)
case .toot:
case .post:
snapshot.appendItems([.toot(replyToTootObjectID: nil, attribute: composeTootAttribute)], toSection: .status)
}
diffableDataSource.apply(snapshot, animatingDifferences: false)

View File

@ -36,8 +36,8 @@ final class ComposeViewModel {
self.context = context
self.composeKind = composeKind
switch composeKind {
case .toot: self.title = CurrentValueSubject(L10n.Scene.Compose.Title.newToot)
case .replyToot: self.title = CurrentValueSubject(L10n.Scene.Compose.Title.newReply)
case .post: self.title = CurrentValueSubject(L10n.Scene.Compose.Title.newPost)
case .reply: self.title = CurrentValueSubject(L10n.Scene.Compose.Title.newReply)
}
self.activeAuthentication = CurrentValueSubject(context.authenticationService.activeMastodonAuthentication.value)
// end init

View File

@ -108,8 +108,8 @@ extension HomeTimelineViewController {
switch item {
case .homeTimelineIndex(let objectID, _):
let homeTimelineIndex = viewModel.fetchedResultsController.managedObjectContext.object(with: objectID) as! HomeTimelineIndex
let toot = homeTimelineIndex.toot.reblog ?? homeTimelineIndex.toot
return toot.poll != nil
let post = homeTimelineIndex.toot.reblog ?? homeTimelineIndex.toot
return post.poll != nil
default:
return false
}
@ -148,8 +148,8 @@ extension HomeTimelineViewController {
self.context.apiService.backgroundManagedObjectContext.performChanges { [weak self] in
guard let self = self else { return }
for objectID in droppingTootObjectIDs {
guard let toot = try? self.context.apiService.backgroundManagedObjectContext.existingObject(with: objectID) as? Toot else { continue }
self.context.apiService.backgroundManagedObjectContext.delete(toot)
guard let post = try? self.context.apiService.backgroundManagedObjectContext.existingObject(with: objectID) as? Toot else { continue }
self.context.apiService.backgroundManagedObjectContext.delete(post)
}
}
.sink { _ in

View File

@ -166,7 +166,7 @@ extension HomeTimelineViewController {
@objc private func composeBarButtonItemPressed(_ sender: UIBarButtonItem) {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
let composeViewModel = ComposeViewModel(context: context, composeKind: .toot)
let composeViewModel = ComposeViewModel(context: context, composeKind: .post)
coordinator.present(scene: .compose(viewModel: composeViewModel), from: self, transition: .modal(animated: true, completion: nil))
}

View File

@ -88,8 +88,8 @@ class PickServerCell: UITableViewCell {
let expandButton: UIButton = {
let button = UIButton(type: .custom)
button.setTitle(L10n.Scene.ServerPicker.Button.seemore, for: .normal)
button.setTitle(L10n.Scene.ServerPicker.Button.seeless, for: .selected)
button.setTitle(L10n.Scene.ServerPicker.Button.seeMore, for: .normal)
button.setTitle(L10n.Scene.ServerPicker.Button.seeLess, for: .selected)
button.setTitleColor(Asset.Colors.lightBrandBlue.color, for: .normal)
button.titleLabel?.font = .preferredFont(forTextStyle: .footnote)
button.translatesAutoresizingMaskIntoConstraints = false

View File

@ -350,7 +350,7 @@ extension StatusView {
NSLayoutConstraint.activate([
audioView.leadingAnchor.constraint(equalTo: statusTextContainerView.leadingAnchor),
audioView.trailingAnchor.constraint(equalTo: statusTextContainerView.trailingAnchor),
audioView.heightAnchor.constraint(equalToConstant: 44)
audioView.heightAnchor.constraint(equalToConstant: 44).priority(.defaultHigh)
])
// video gif
statusContainerStackView.addArrangedSubview(mosaicPlayerView)