Skip to content

Commit

Permalink
Ensure menu entries' titles are at most 28 char long
Browse files Browse the repository at this point in the history
This reuse the code for preference's title.

Its distinct issues, because the description mentioned the limit, and
the description must be a constant.

This commit also updated all string resources to add the 28 character
limit.

It should be noted that, while most menus are shown as context
menu/overflow menu, there is one exception. The sidebar menu. Still,
it seems to me that 28 characters for statistics, card browser, deck
picker, is also a reasonable constraint. The side menu is relatively
small, and the text is big.
Admittedly, we allow for two lines there if necessary, so it should
still be okay with long-ish strings.
  • Loading branch information
Arthur-Milchior authored and lukstbit committed Oct 23, 2024
1 parent 197b2bc commit 3bc3bee
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 122 deletions.
72 changes: 36 additions & 36 deletions AnkiDroid/src/main/res/values/01-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Navigation drawer items-->
<string name="decks">Decks</string>
<string name="card_browser" maxLength="41" comment="The usage of card browser inside the app (note the casing)">Card browser</string>
<string name="statistics">Statistics</string>
<string name="settings">Settings</string>
<string name="help">Help</string>
<string name="decks" maxLength="28">Decks</string>
<string name="card_browser" maxLength="28" comment="The usage of card browser inside the app (note the casing)">Card browser</string>
<string name="statistics" maxLength="28">Statistics</string>
<string name="settings" maxLength="28">Settings</string>
<string name="help" maxLength="28">Help</string>
<string name="drawing">Drawing</string>
<string name="send_feedback">Send feedback</string>

Expand Down Expand Up @@ -59,36 +59,36 @@
<string name="ease_button_hard" maxLength="41">Hard</string>
<string name="ease_button_good" maxLength="41">Good</string>
<string name="ease_button_easy">Easy</string>
<string name="menu_import">Import</string>
<string name="undo" maxLength="29" comment="When tapping on this text, the last action is undone.">Undo</string>
<string name="redo" maxLength="41">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="menu_import" maxLength="28">Import</string>
<string name="undo" maxLength="28" comment="When tapping on this text, the last action is undone.">Undo</string>
<string name="redo" maxLength="28">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)" maxLength="28">Undo stroke</string>
<string name="move_all_to_deck">Move all to deck</string>
<string name="unbury">Unbury</string>
<string name="rename_deck">Rename deck</string>
<string name="unbury" maxLength="28">Unbury</string>
<string name="rename_deck" maxLength="28">Rename deck</string>
<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" maxLength="29">Add</string>
<string name="menu_add_note" maxLength="41">Add note</string>
<string name="menu_add" comment="A generic add button. Please inform us if you need more specific strings" maxLength="28">Add</string>
<string name="menu_add_note" maxLength="28">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" maxLength="41">Hide / delete</string>
<string name="menu_bury_card" maxLength="41">Bury card</string>
<string name="menu_bury_note" maxLength="41">Bury note</string>
<string name="menu_suspend_card" maxLength="41">Suspend card</string>
<string name="menu_suspend_note" maxLength="41">Suspend note</string>
<string name="menu_bury" maxLength="41">Bury</string>
<string name="menu_suspend" maxLength="41">Suspend</string>
<string name="menu_delete_note" maxLength="41">Delete note</string>
<string name="menu_dismiss_note" maxLength="41" >Hide / delete</string>
<string name="menu_bury_card" maxLength="28">Bury card</string>
<string name="menu_bury_note" maxLength="28">Bury note</string>
<string name="menu_suspend_card" maxLength="28">Suspend card</string>
<string name="menu_suspend_note" maxLength="28">Suspend note</string>
<string name="menu_bury" maxLength="28">Bury</string>
<string name="menu_suspend" maxLength="28">Suspend</string>
<string name="menu_delete_note" maxLength="28">Delete note</string>
<string name="menu_flag" maxLength="41">Flag</string>
<string name="rename_flag">Rename flags</string>
<string name="menu_flag_card">Flag card</string>
<string name="menu_edit_tags" maxLength="41">Edit tags</string>
<string name="menu_flag_card" maxLength="28">Flag card</string>
<string name="menu_edit_tags" maxLength="28">Edit tags</string>
<string name="delete_note_message">Really delete this note and all its cards?\n%s</string>
<string name="menu_search">Lookup in %1$s</string>
<string name="menu_mark_note" maxLength="41">Mark note</string>
<string name="menu_search" maxLength="28">Lookup in %1$s</string>
<string name="menu_mark_note" maxLength="28">Mark note</string>
<string name="menu_unmark_note">Unmark note</string>
<string name="menu_enable_voice_playback" maxLength="41">Enable voice playback</string>
<string name="menu_enable_voice_playback" maxLength="28">Enable voice playback</string>
<string name="menu_disable_voice_playback">Disable voice playback</string>
<string name="new_deck">Create deck</string>
<string name="new_dynamic_deck">Create filtered deck</string>
Expand All @@ -99,39 +99,39 @@
of the permissions/app info screen will differ between devices. -->
<string name="startup_no_storage_permission">Please grant AnkiDroid the ‘Storage’ permission to continue</string>
<string name="rebuild_filtered_deck">Rebuilding filtered deck…</string>
<string name="rebuild_cram_label">Rebuild</string>
<string name="empty_cram_label">Empty</string>
<string name="rebuild_cram_label" maxLength="28">Rebuild</string>
<string name="empty_cram_label" maxLength="28">Empty</string>
<string name="create_subdeck">Create subdeck</string>
<string name="empty_filtered_deck">Emptying filtered deck…</string>
<string name="custom_study_deck_name">Custom study session</string>
<string name="custom_study_deck_exists">Rename the existing custom study deck first</string>
<string name="search_deck" comment="Deck search for selecting it">Deck Search</string>
<string name="empty_deck">This deck is empty</string>
<string name="search_for_download_deck" comment="Deck search value for downloading deck">Deck Search</string>
<string name="search_for_download_deck" comment="Deck search value for downloading deck" maxLength="28">Deck Search</string>
<string name="invalid_deck_name">Invalid deck name</string>
<string name="studyoptions_congrats_finished">Congratulations! You have finished for now.</string>
<string name="studyoptions_congrats_next_due_in" comment="The param will be replaced with 'The next card will be ready in X time'">Deck finished for now! %s</string>
<string name="studyoptions_no_cards_due">No cards are due yet</string>

<string name="sd_card_not_mounted">Device storage not mounted</string>
<string name="button_sync" comment="Text of the sync button">Sync</string>
<string name="button_sync" comment="Text of the sync button" maxLength="28">Sync</string>
<string name="cancel_sync_confirm" tools:ignore="UnusedResources">Do you want to cancel the sync?</string>
<string name="continue_sync" tools:ignore="UnusedResources">Continue sync</string>
<string name="sync_cancelled" tools:ignore="UnusedResources">Sync cancelled</string>
<string name="sync_cancel_message" tools:ignore="UnusedResources">Cancelling…\nThis may take some time.</string>
<string name="syncing_media">Syncing media</string>
<string name="export_deck">Export deck</string>
<string name="export_deck" maxLength="28">Export deck</string>
<string name="export_collection">Export collection</string>
<string name="nothing">Nothing</string>

<!-- Card template editor -->
<string name="title_activity_template_editor">Card types</string>
<string name="card_template_editor_front">Front template</string>
<string name="card_template_editor_back">Back template</string>
<string name="card_template_editor_styling">Styling</string>
<string name="card_template_editor_menu_card_browser_appearance">Card Browser Appearance</string>
<string name="card_template_editor_deck_override">Deck override</string>
<string name="card_template_editor_insert_field">Insert field</string>
<string name="card_template_editor_styling" maxLength="28">Styling</string>
<string name="card_template_editor_menu_card_browser_appearance" maxLength="28">Card Browser Appearance</string>
<string name="card_template_editor_deck_override" maxLength="28">Deck override</string>
<string name="card_template_editor_insert_field" maxLength="28">Insert field</string>
<string name="card_template_editor_select_field">Select field</string>
<string name="card_template_editor_cant_delete">At least one card type is required</string>
<plurals name="card_template_editor_confirm_add">
Expand All @@ -149,7 +149,7 @@
<string name="card_template_browser_appearance_title">Browser appearance</string>

<!-- card Info -->
<string name="card_info_title" maxLength="41">Card info</string>
<string name="card_info_title" maxLength="28">Card info</string>

<!-- Permissions -->
<string name="read_write_permission_label">Read and write to the AnkiDroid database</string>
Expand Down
Loading

0 comments on commit 3bc3bee

Please sign in to comment.