From 180efbc5782a333ed7285d98476f25eb30882be6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 9 Feb 2021 09:50:59 +1000 Subject: [PATCH] recent -> today 'Current deck' has moved, and by removing 'due tomorrow', we can drop the 'today' suffix on the rest of the items. The keys of the existing translations have not been changed, so existing translations will not break, but will need to be manually updated to make them shorter. --- ftl/core/browsing.ftl | 14 ++++++-------- qt/aqt/sidebar.py | 28 +++++++++++----------------- rslib/backend.proto | 2 +- rslib/src/config.rs | 10 +++++----- 4 files changed, 23 insertions(+), 31 deletions(-) diff --git a/ftl/core/browsing.ftl b/ftl/core/browsing.ftl index bb82a0d74..4568d0dde 100644 --- a/ftl/core/browsing.ftl +++ b/ftl/core/browsing.ftl @@ -1,10 +1,7 @@ browsing-add-notes = Add Notes... browsing-add-tags = Add Tags browsing-add-tags2 = Add Tags... -browsing-added-today = Added Today browsing-addon = Add-on -browsing-again-today = Again Today -browsing-edited-today = Edited Today browsing-all-card-types = All Card Types browsing-all-fields = All Fields browsing-answer = Answer @@ -91,12 +88,10 @@ browsing-sort-field = Sort Field browsing-sorting-on-this-column-is-not = Sorting on this column is not supported. Please choose another. browsing-start-position = Start position: browsing-step = Step: -browsing-studied-today = Studied Today browsing-suspended = Suspended browsing-tag-duplicates = Tag Duplicates browsing-tag-rename-warning-empty = You can't rename a tag that has no notes. browsing-target-field = Target field: -browsing-today = Today browsing-toggle-mark = Toggle Mark browsing-toggle-suspend = Toggle Suspend browsing-treat-input-as-regular-expression = Treat input as regular expression @@ -127,6 +122,9 @@ browsing-sidebar-saved-searches = Saved Searches browsing-sidebar-save-current-search = Save Current Search browsing-sidebar-card-state = Card State browsing-sidebar-flags = Flags -browsing-sidebar-recent = Recent -browsing-sidebar-due-today = Due Today -browsing-sidebar-due-tomorrow = Due Tomorrow +browsing-today = Today +browsing-studied-today = Studied +browsing-added-today = Added +browsing-again-today = Again +browsing-edited-today = Edited +browsing-sidebar-due-today = Due diff --git a/qt/aqt/sidebar.py b/qt/aqt/sidebar.py index 246d4ed50..412dfd3c1 100644 --- a/qt/aqt/sidebar.py +++ b/qt/aqt/sidebar.py @@ -34,8 +34,8 @@ class SidebarItemType(Enum): ROOT = auto() SAVED_SEARCH_ROOT = auto() SAVED_SEARCH = auto() - RECENT_ROOT = auto() - RECENT = auto() + TODAY_ROOT = auto() + TODAY = auto() CARD_STATE_ROOT = auto() CARD_STATE = auto() FLAG_ROOT = auto() @@ -61,7 +61,7 @@ class SidebarItemType(Enum): class SidebarStage(Enum): ROOT = auto() SAVED_SEARCHES = auto() - RECENT = auto() + TODAY = auto() SCHEDULING = auto() FLAGS = auto() DECKS = auto() @@ -517,8 +517,8 @@ class SidebarTreeView(QTreeView): self._saved_searches_tree(root) elif stage is SidebarStage.SCHEDULING: self._card_state_tree(root) - elif stage is SidebarStage.RECENT: - self._recent_tree(root) + elif stage is SidebarStage.TODAY: + self._today_tree(root) elif stage is SidebarStage.FLAGS: self._flags_tree(root) elif stage is SidebarStage.DECKS: @@ -587,19 +587,19 @@ class SidebarTreeView(QTreeView): ) root.add_child(item) - # Tree: Recent + # Tree: Today ########################### - def _recent_tree(self, root: SidebarItem) -> None: + def _today_tree(self, root: SidebarItem) -> None: icon = ":/icons/clock.svg" root = self._section_root( root=root, - name=TR.BROWSING_SIDEBAR_RECENT, + name=TR.BROWSING_TODAY, icon=icon, - collapse_key=Config.Bool.COLLAPSE_RECENT, - type=SidebarItemType.RECENT_ROOT, + collapse_key=Config.Bool.COLLAPSE_TODAY, + type=SidebarItemType.TODAY_ROOT, ) - type = SidebarItemType.RECENT + type = SidebarItemType.TODAY search = self._filter_func root.add_simple( @@ -636,12 +636,6 @@ class SidebarTreeView(QTreeView): ) ), ) - root.add_simple( - name=TR.BROWSING_SIDEBAR_DUE_TOMORROW, - icon=icon, - type=type, - on_click=search(SearchTerm(due_in_days=1)), - ) # Tree: Card State ########################### diff --git a/rslib/backend.proto b/rslib/backend.proto index e5ddab6d5..245d94adc 100644 --- a/rslib/backend.proto +++ b/rslib/backend.proto @@ -1220,7 +1220,7 @@ message Config { COLLAPSE_NOTETYPES = 3; COLLAPSE_DECKS = 4; COLLAPSE_SAVED_SEARCHES = 5; - COLLAPSE_RECENT = 6; + COLLAPSE_TODAY = 6; COLLAPSE_CARD_STATE = 7; COLLAPSE_FLAGS = 8; } diff --git a/rslib/src/config.rs b/rslib/src/config.rs index beea09585..eb1555a42 100644 --- a/rslib/src/config.rs +++ b/rslib/src/config.rs @@ -47,9 +47,9 @@ pub(crate) enum ConfigKey { CollapseDecks, CollapseFlags, CollapseNotetypes, - CollapseRecent, CollapseSavedSearches, CollapseTags, + CollapseToday, CreationOffset, CurrentDeckID, CurrentNoteTypeID, @@ -84,13 +84,13 @@ impl From for &'static str { ConfigKey::BrowserSortKind => "sortType", ConfigKey::BrowserSortReverse => "sortBackwards", ConfigKey::CardCountsSeparateInactive => "cardCountsSeparateInactive", - ConfigKey::CollapseRecent => "collapseRecent", ConfigKey::CollapseCardState => "collapseCardState", - ConfigKey::CollapseFlags => "collapseFlags", ConfigKey::CollapseDecks => "collapseDecks", - ConfigKey::CollapseSavedSearches => "collapseSavedSearches", + ConfigKey::CollapseFlags => "collapseFlags", ConfigKey::CollapseNotetypes => "collapseNotetypes", + ConfigKey::CollapseSavedSearches => "collapseSavedSearches", ConfigKey::CollapseTags => "collapseTags", + ConfigKey::CollapseToday => "collapseToday", ConfigKey::CreationOffset => "creationOffset", ConfigKey::CurrentDeckID => "curDeck", ConfigKey::CurrentNoteTypeID => "curModel", @@ -122,9 +122,9 @@ impl From for ConfigKey { BoolKey::CollapseDecks => ConfigKey::CollapseDecks, BoolKey::CollapseFlags => ConfigKey::CollapseFlags, BoolKey::CollapseNotetypes => ConfigKey::CollapseNotetypes, - BoolKey::CollapseRecent => ConfigKey::CollapseRecent, BoolKey::CollapseSavedSearches => ConfigKey::CollapseSavedSearches, BoolKey::CollapseTags => ConfigKey::CollapseTags, + BoolKey::CollapseToday => ConfigKey::CollapseToday, BoolKey::PreviewBothSides => ConfigKey::PreviewBothSides, } }