From 5637056790dd6de303f4074212acebd99e362236 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 7 Feb 2023 16:56:49 -0500 Subject: [PATCH] =?UTF-8?q?Add=20label=20to=20=E2=80=9CAdd=20Option?= =?UTF-8?q?=E2=80=9D=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Localization/app.json | 1 + .../Sources/MastodonLocalization/Generated/Strings.swift | 2 ++ .../Resources/Base.lproj/Localizable.strings | 1 + .../Scene/ComposeContent/View/ComposeContentView.swift | 8 ++++---- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Localization/app.json b/Localization/app.json index e6219b4a65..6d6ad4ac4f 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -471,6 +471,7 @@ "option_number": "Option %ld", "the_poll_is_invalid": "The poll is invalid", "the_poll_has_empty_option": "The poll has empty option", + "add_option": "Add Option", "remove_option": "Remove Option", "move_up": "Move Up", "move_down": "Move Down" diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index c75bb9fd9b..8768012f35 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -593,6 +593,8 @@ public enum L10n { public static let photoLibrary = L10n.tr("Localizable", "Scene.Compose.MediaSelection.PhotoLibrary", fallback: "Photo Library") } public enum Poll { + /// Add Option + public static let addOption = L10n.tr("Localizable", "Scene.Compose.Poll.AddOption", fallback: "Add Option") /// Duration: %@ public static func durationTime(_ p1: Any) -> String { return L10n.tr("Localizable", "Scene.Compose.Poll.DurationTime", String(describing: p1), fallback: "Duration: %@") diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 2f57c40fee..d9c9a29269 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -211,6 +211,7 @@ uploaded to Mastodon."; "Scene.Compose.MediaSelection.Browse" = "Browse"; "Scene.Compose.MediaSelection.Camera" = "Take Photo"; "Scene.Compose.MediaSelection.PhotoLibrary" = "Photo Library"; +"Scene.Compose.Poll.AddOption" = "Add Option"; "Scene.Compose.Poll.DurationTime" = "Duration: %@"; "Scene.Compose.Poll.MoveDown" = "Move Down"; "Scene.Compose.Poll.MoveUp" = "Move Up"; diff --git a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/View/ComposeContentView.swift b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/View/ComposeContentView.swift index 26dec726d8..714b751b76 100644 --- a/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/View/ComposeContentView.swift +++ b/MastodonSDK/Sources/MastodonUI/Scene/ComposeContent/View/ComposeContentView.swift @@ -200,10 +200,10 @@ extension ComposeContentView { } } if viewModel.maxPollOptionLimit != viewModel.pollOptions.count { - PollAddOptionRow() - .onTapGesture { - viewModel.createNewPollOptionIfCould() - } + Button(action: viewModel.createNewPollOptionIfCould) { + PollAddOptionRow() + .accessibilityLabel(L10n.Scene.Compose.Poll.addOption) + } } Menu { Picker(selection: $viewModel.pollExpireConfigurationOption) {