Skip to content

Commit

Permalink
Add maxLength="29" to card browser's menu entry.
Browse files Browse the repository at this point in the history
If menu item's title can't fit into one line in the screen, it's
truncated. Which makes some menu entry not understandable on small
sceren when user's text size is big.

I counted the number of displayed character in such a truncated field,
it's 29.

This seems like a reasonnable limit anyway for a menu entry title.

If this is accepted, then I'll do the same for every other menu. And
ideally, we should have a linter that ensure that any item's
android:title has the same limit.

Admittedly, it'd be great to be able to also show big string, because
translators won't re-translate quickly, if ever. But that seems to a
surpisingly hard problem.
  • Loading branch information
Arthur-Milchior authored and mikehardy committed Oct 2, 2024
1 parent 76456a0 commit 75d07a0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/res/menu/card_browser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_white"
android:title="@string/deck_conf_cram_search"
android:title="@string/card_browser_cram_search"
ankidroid:actionViewClass="com.ichi2.ui.CardBrowserSearchView"
ankidroid:showAsAction="always|collapseActionView"/>

Expand Down
4 changes: 2 additions & 2 deletions AnkiDroid/src/main/res/values/01-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<string name="ease_button_good">Good</string>
<string name="ease_button_easy">Easy</string>
<string name="menu_import">Import</string>
<string name="undo">Undo</string>
<string name="undo" maxLength="29" comment="When tapping on this text, the last action is undone.">Undo</string>
<string name="redo">Redo</string>
<string name="undo_action_whiteboard_last_stroke" comment="One of the display patterns of 'Undo' item on the action menu in Reviewer. It is shown as the title of the item when the whiteboard (handwriting) feature is enabled and visible and has any strokes (handwritten lines)">Undo stroke</string>
<string name="move_all_to_deck">Move all to deck</string>
Expand All @@ -69,7 +69,7 @@
<string name="create_shortcut">Create shortcut</string>
<string name="browse_cards">Browse cards</string>
<string name="edit_deck_description" comment="edit the deck description">Edit description</string>
<string name="menu_add" comment="A generic add button. Please inform us if you need more specific strings">Add</string>
<string name="menu_add" comment="A generic add button. Please inform us if you need more specific strings" maxLength="29">Add</string>
<string name="menu_add_note">Add note</string>
<string name="menu_my_account" comment="Label of the window in which the user should enter their account. This text can't be found in AnkiDroid directly.">Sync account</string>
<string name="menu_dismiss_note">Hide / delete</string>
Expand Down
4 changes: 2 additions & 2 deletions AnkiDroid/src/main/res/values/02-strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<string name="card_editor_reposition_card" comment="reposition a card in the new queue">Reposition</string>
<string name="card_editor_reset_card">Reset progress</string>
<string name="card_editor_reschedule_card" comment="Action to reschedule a card">Reschedule</string>
<string name="card_editor_preview_card" comment="Button offering to preview some card(s)">Preview</string>
<string name="card_editor_preview_card" comment="Button offering to preview some card(s)" maxLength="29">Preview</string>
<string name="copy_as_markdown" comment="Copies text to the clipboard as Markdown">Copy as Markdown</string>
<string name="preview_progress_bar_text" comment="What card we are on out of how many in card previewer progress bar">%1$d of %2$d</string>
<string name="rename" comment="Confirm that the renaming action should be processed.">Rename</string>
Expand Down Expand Up @@ -153,7 +153,7 @@
<string name="export_choice_share">Share</string>
<string name="export_choice_save_to">Save to</string>
<string name="export_saving_exported_collection">Saving exported file&#8230;</string>
<string name="study_options" comment="Name for a preference category in Filtered deck (aka Cram deck, aka Custom study) options">Options</string>
<string name="study_options" comment="Name for a preference category in Filtered deck (aka Cram deck, aka Custom study) options" maxLength="29">Options</string>
<string name="menu__deck_options">Deck options</string>
<string name="menu__study_options" comment="Menu item that opens options for a Filtered deck (aka Cram deck, aka Custom study)">Study options</string>
<string name="select_tts">Set TTS language</string>
Expand Down
17 changes: 9 additions & 8 deletions AnkiDroid/src/main/res/values/07-cardbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@
</plurals>
<string name="card_browser_change_deck">Change deck</string>
<string name="delete_card_title">Delete note?</string>
<string name="card_browser_show_marked">Filter marked</string>
<string name="card_browser_show_suspended">Filter suspended</string>
<string name="card_browser_search_by_tag">Filter by tag</string>
<string name="card_browser_search_by_flag">Filter by flag</string>
<string name="card_browser_list_my_searches">My searches</string>
<string name="card_browser_list_my_searches_save">Save search</string>
<string name="card_browser_show_marked" maxLength="29">Filter marked</string>
<string name="card_browser_show_suspended" maxLength="29">Filter suspended</string>
<string name="card_browser_search_by_tag" maxLength="29">Filter by tag</string>
<string name="card_browser_search_by_flag" maxLength="29">Filter by flag</string>
<string name="card_browser_list_my_searches" maxLength="29">My searches</string>
<string name="card_browser_list_my_searches_save" maxLength="29">Save search</string>
<string name="card_browser_list_my_searches_title">Choose a saved search</string>
<string name="card_browser_list_my_searches_new_name">Name for the current search</string>
<string name="card_browser_list_my_searches_new_search_error_empty_name">You can’t save a search without a name</string>
<string name="card_browser_list_my_searches_new_search_error_dup">Name exists</string>
<string name="no_note_to_edit">No note to edit</string>
<string name="card_browser_list_my_searches_remove_content">Delete “%1$s”?</string>
<string name="card_browser_change_display_order">Change display order</string>
<string name="card_browser_change_display_order" maxLength="29">Change display order</string>
<string name="card_browser_search_hint" comment="Message displayed in the search text field in the card browser.">Search</string>
<string name="card_browser_cram_search" maxLength="29" comment = "Menu entry to start a search.">Search</string>
<string name="card_browser_change_display_order_title">Choose display order</string>
<string name="card_details_tags">Tags</string>
<string-array name="card_browser_order_labels">
Expand All @@ -64,7 +65,7 @@
<item>By reviews</item>
<item>By lapses</item>
</string-array>
<string name="card_browser_select_all">Select all</string>
<string name="card_browser_select_all" maxLength="29">Select all</string>
<string name="card_browser_select_none">Select none</string>
<string name="card_browser_interval_new_card" comment="Message indicating that a card is currently new, and so has no interval/ease.">(new)</string>
<string name="card_browser_due_filtered_card">(filtered)</string>
Expand Down
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/res/values/10-preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<string name="deck_conf_general" maxLength="41" comment="Label of the submenu for the general options of new deck">General</string>
<string name="deck_conf_reminders" maxLength="41">Reminders</string>
<string name="deck_conf_cram_filter" maxLength="41">Filter</string>
<string name="deck_conf_cram_search" maxLength="41" comment = "Label of a text field that contains a search query. It is also used outside fo the card filtered deck menu.">Search</string>
<string name="deck_conf_cram_search" maxLength="41" comment = "Label of a text field that contains a search query.">Search</string>
<string name="deck_conf_cram_limit" maxLength="41">Limit to</string>
<string name="deck_conf_cram_order" maxLength="41">Cards selected by</string>
<string name="deck_conf_cram_reschedule" maxLength="41" comment="Title of the box labelled by deck_conf_cram_reschedule_summ">Reschedule</string>
Expand Down

0 comments on commit 75d07a0

Please sign in to comment.