Skip to content

Commit

Permalink
improvement(deck-options): fix casing of title
Browse files Browse the repository at this point in the history
  • Loading branch information
david-allison committed Jan 8, 2025
1 parent 16a4de8 commit f08cb9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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()
}
Expand Down
1 change: 1 addition & 0 deletions AnkiDroid/src/main/res/values/sentence-case.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ undoActionUndone()
<string name="sentence_gesture_abort_sync">Abort learning and sync</string>
<string name="sentence_gesture_toggle_whiteboard">Toggle whiteboard</string>
<string name="sentence_custom_study">Custom study</string>
<string name="sentence_browser_options">Browser options</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -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?"))
}
Expand Down

0 comments on commit f08cb9e

Please sign in to comment.