Localize username-suggestion (#690)

Please be aware of the username-requirements, when changing the localized versions.
This commit is contained in:
Nathan Mattes 2022-12-28 15:03:50 +01:00
parent 3e76f43637
commit 18e25aea30
5 changed files with 10 additions and 3 deletions

View File

@ -329,7 +329,8 @@
},
"username": {
"placeholder": "username",
"duplicate_prompt": "This username is taken."
"duplicate_prompt": "This username is taken.",
"suggestion": "amazing_%@"
},
"display_name": {
"placeholder": "display name"

View File

@ -49,9 +49,9 @@ struct MastodonRegisterView: View {
Button {
viewModel.usernameErrorPrompt = nil
viewModel.usernameValidateState = .empty
viewModel.username = "amazing_\(viewModel.username)"
viewModel.username = L10n.Scene.Register.Input.Username.suggestion(viewModel.username)
} label: {
Text("amazing_\(viewModel.username)")
Text(L10n.Scene.Register.Input.Username.suggestion(viewModel.username))
.foregroundColor(Asset.Colors.Brand.blurple.swiftUIColor)
.font(Font(UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .bold))))

View File

@ -1034,6 +1034,10 @@ public enum L10n {
public static let duplicatePrompt = L10n.tr("Localizable", "Scene.Register.Input.Username.DuplicatePrompt", fallback: "This username is taken.")
/// username
public static let placeholder = L10n.tr("Localizable", "Scene.Register.Input.Username.Placeholder", fallback: "username")
/// amazing_%@
public static func suggestion(_ p1: Any) -> String {
return L10n.tr("Localizable", "Scene.Register.Input.Username.Suggestion", String(describing: p1), fallback: "amazing_%@")
}
}
}
}

View File

@ -351,6 +351,7 @@ uploaded to Mastodon.";
"Scene.Register.Input.Password.Require" = "Your password needs at least:";
"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.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?";

View File

@ -342,6 +342,7 @@ uploaded to Mastodon.";
"Scene.Register.Input.Password.Require" = "Your password needs at least:";
"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.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?";