Improve Create Account VQA IOS-138 (#999)

This commit is contained in:
Marcus Kida 2023-04-04 16:21:47 +02:00 committed by GitHub
parent 1672121675
commit 7bdc37ac05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 16 deletions

View File

@ -80,7 +80,7 @@
"save_photo": "Save Photo",
"copy_photo": "Copy Photo",
"sign_in": "Log in",
"sign_up": "Create account",
"sign_up": "Create Account",
"see_more": "See More",
"preview": "Preview",
"copy": "Copy",
@ -353,7 +353,7 @@
}
},
"register": {
"title": "Create account",
"title": "Create Account",
"input": {
"avatar": {
"delete": "Delete"
@ -396,7 +396,7 @@
"reason": {
"blocked": "%s contains a disallowed email provider",
"unreachable": "%s does not seem to exist",
"taken": "%s is already in use",
"taken": "%s is already taken. How about:",
"reserved": "%s is a reserved keyword",
"accepted": "%s must be accepted",
"blank": "%s is required",

View File

@ -60,6 +60,7 @@ extension MastodonRegisterViewController {
hostingViewController.view.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(hostingViewController.view)
hostingViewController.view.pinToParent()
hostingViewController.view.backgroundColor = view.backgroundColor
navigationItem.rightBarButtonItem = nextBarButtonItem()

View File

@ -80,6 +80,7 @@ final class MastodonRegisterViewModel: ObservableObject {
.store(in: &disposeBag)
$username
.removeDuplicates()
.map { username in
guard !username.isEmpty else { return .empty }
var isValid = true
@ -152,7 +153,7 @@ final class MastodonRegisterViewModel: ObservableObject {
Publishers.CombineLatest($password, $passwordConfirmation)
.map { password, confirmation in
guard !password.isEmpty else { return .empty }
guard !password.isEmpty && !confirmation.isEmpty else { return .empty }
if password.count >= 8 && password == confirmation {
return .valid

View File

@ -178,8 +178,8 @@ public enum L10n {
}
/// Log in
public static let signIn = L10n.tr("Localizable", "Common.Controls.Actions.SignIn", fallback: "Log in")
/// Create account
public static let signUp = L10n.tr("Localizable", "Common.Controls.Actions.SignUp", fallback: "Create account")
/// Create Account
public static let signUp = L10n.tr("Localizable", "Common.Controls.Actions.SignUp", fallback: "Create Account")
/// Skip
public static let skip = L10n.tr("Localizable", "Common.Controls.Actions.Skip", fallback: "Skip")
/// Take Photo
@ -1004,8 +1004,8 @@ public enum L10n {
public static let title = L10n.tr("Localizable", "Scene.RebloggedBy.Title", fallback: "Reblogged By")
}
public enum Register {
/// Create account
public static let title = L10n.tr("Localizable", "Scene.Register.Title", fallback: "Create account")
/// Create Account
public static let title = L10n.tr("Localizable", "Scene.Register.Title", fallback: "Create Account")
public enum Error {
public enum Item {
/// Agreement
@ -1046,9 +1046,9 @@ public enum L10n {
public static func reserved(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.Register.Error.Reason.Reserved", String(describing: p1), fallback: "%@ is a reserved keyword")
}
/// %@ is already in use
/// %@ is already taken. How about:
public static func taken(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.Register.Error.Reason.Taken", String(describing: p1), fallback: "%@ is already in use")
return L10n.tr("Localizable", "Scene.Register.Error.Reason.Taken", String(describing: p1), fallback: "%@ is already taken. How about:")
}
/// %@ is too long
public static func tooLong(_ p1: Any) -> String {

View File

@ -61,7 +61,7 @@ Please check your internet connection.";
"Common.Controls.Actions.SharePost" = "Share Post";
"Common.Controls.Actions.ShareUser" = "Share %@";
"Common.Controls.Actions.SignIn" = "Log in";
"Common.Controls.Actions.SignUp" = "Create account";
"Common.Controls.Actions.SignUp" = "Create Account";
"Common.Controls.Actions.Skip" = "Skip";
"Common.Controls.Actions.TakePhoto" = "Take Photo";
"Common.Controls.Actions.TranslatePost.Title" = "Translate from %@";
@ -361,7 +361,7 @@ uploaded to Mastodon.";
"Scene.Register.Error.Reason.Inclusion" = "%@ is not a supported value";
"Scene.Register.Error.Reason.Invalid" = "%@ is invalid";
"Scene.Register.Error.Reason.Reserved" = "%@ is a reserved keyword";
"Scene.Register.Error.Reason.Taken" = "%@ is already in use";
"Scene.Register.Error.Reason.Taken" = "%@ is already taken. How about:";
"Scene.Register.Error.Reason.TooLong" = "%@ is too long";
"Scene.Register.Error.Reason.TooShort" = "%@ is too short";
"Scene.Register.Error.Reason.Unreachable" = "%@ does not seem to exist";
@ -383,7 +383,7 @@ uploaded to Mastodon.";
"Scene.Register.Input.Username.DuplicatePrompt" = "This username is taken.";
"Scene.Register.Input.Username.Placeholder" = "username";
"Scene.Register.Input.Username.Suggestion" = "amazing_%@";
"Scene.Register.Title" = "Create account";
"Scene.Register.Title" = "Create Account";
"Scene.Report.Content1" = "Are there any other posts youd like to add to the report?";
"Scene.Report.Content2" = "Is there anything the moderators should know about this report?";
"Scene.Report.ReportSentTitle" = "Thanks for reporting, well look into this.";
@ -548,4 +548,4 @@ back in your hands.";
"Widget.MultipleFollowers.ConfigurationDescription" = "Show number of followers for multiple accounts.";
"Widget.MultipleFollowers.ConfigurationDisplayName" = "Multiple followers";
"Widget.MultipleFollowers.MockUser.AccountName" = "another@follower.social";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";

View File

@ -361,7 +361,7 @@ uploaded to Mastodon.";
"Scene.Register.Error.Reason.Inclusion" = "%@ is not a supported value";
"Scene.Register.Error.Reason.Invalid" = "%@ is invalid";
"Scene.Register.Error.Reason.Reserved" = "%@ is a reserved keyword";
"Scene.Register.Error.Reason.Taken" = "%@ is already in use";
"Scene.Register.Error.Reason.Taken" = "%@ is already taken. How about:";
"Scene.Register.Error.Reason.TooLong" = "%@ is too long";
"Scene.Register.Error.Reason.TooShort" = "%@ is too short";
"Scene.Register.Error.Reason.Unreachable" = "%@ does not seem to exist";
@ -551,4 +551,4 @@ back in your hands.";
"Widget.MultipleFollowers.ConfigurationDescription" = "Show number of followers for multiple accounts.";
"Widget.MultipleFollowers.ConfigurationDisplayName" = "Multiple followers";
"Widget.MultipleFollowers.MockUser.AccountName" = "another@follower.social";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";