From f08cb9e18628b951ebf569cdd9436649fd44928a Mon Sep 17 00:00:00 2001 From: David Allison <62114487+david-allison@users.noreply.github.com> Date: Wed, 8 Jan 2025 01:15:17 +0000 Subject: [PATCH] improvement(deck-options): fix casing of title --- .../java/com/ichi2/anki/dialogs/BrowserOptionsDialog.kt | 6 +++++- AnkiDroid/src/main/res/values/sentence-case.xml | 1 + .../ichi2/anki/ui/internationalization/SentenceCaseTest.kt | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/BrowserOptionsDialog.kt b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/BrowserOptionsDialog.kt index b08a10a6f627..47fe844aa93b 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/BrowserOptionsDialog.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/BrowserOptionsDialog.kt @@ -32,6 +32,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.ichi2.anki.R import com.ichi2.anki.browser.CardBrowserViewModel import com.ichi2.anki.model.CardsOrNotes +import com.ichi2.anki.ui.internationalization.toSentenceCase import timber.log.Timber class BrowserOptionsDialog : AppCompatDialogFragment() { @@ -94,7 +95,10 @@ class BrowserOptionsDialog : AppCompatDialogFragment() { return MaterialAlertDialogBuilder(requireContext()).run { this.setView(dialogView) - this.setTitle(getString(R.string.browser_options_dialog_heading)) + this.setTitle( + getString(R.string.browser_options_dialog_heading) + .toSentenceCase(context, R.string.sentence_browser_options), + ) this.setNegativeButton(getString(R.string.dialog_cancel)) { _: DialogInterface, _: Int -> dismiss() } diff --git a/AnkiDroid/src/main/res/values/sentence-case.xml b/AnkiDroid/src/main/res/values/sentence-case.xml index 06865831d249..977e0fec391c 100644 --- a/AnkiDroid/src/main/res/values/sentence-case.xml +++ b/AnkiDroid/src/main/res/values/sentence-case.xml @@ -41,5 +41,6 @@ undoActionUndone() Abort learning and sync Toggle whiteboard Custom study + Browser options \ No newline at end of file diff --git a/AnkiDroid/src/test/java/com/ichi2/anki/ui/internationalization/SentenceCaseTest.kt b/AnkiDroid/src/test/java/com/ichi2/anki/ui/internationalization/SentenceCaseTest.kt index 83dc28f2b224..e18d80ebc374 100644 --- a/AnkiDroid/src/test/java/com/ichi2/anki/ui/internationalization/SentenceCaseTest.kt +++ b/AnkiDroid/src/test/java/com/ichi2/anki/ui/internationalization/SentenceCaseTest.kt @@ -39,6 +39,13 @@ class SentenceCaseTest : RobolectricTest() { assertThat(TR.actionsSetDueDate().toSentenceCase(this, R.string.sentence_set_due_date), equalTo("Set due date")) assertThat(TR.actionsCustomStudy().toSentenceCase(this, R.string.sentence_custom_study), equalTo("Custom study")) + // not fixing on Crowdin to avoid a re-translate + assertThat( + getString(R.string.browser_options_dialog_heading) + .toSentenceCase(this, R.string.sentence_browser_options), + equalTo("Browser options"), + ) + assertThat("Toggle Suspend".toSentenceCase(this, R.string.sentence_toggle_suspend), equalTo("Toggle suspend")) assertThat("Ook? Ook?".toSentenceCase(this, R.string.sentence_toggle_suspend), equalTo("Ook? Ook?")) }