From 1b89db804ac91c8339128f32b7dd773a92bd86ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabri=20=C3=9Cnal?= Date: Fri, 26 Apr 2024 21:31:06 +0300 Subject: [PATCH] draft: test: ui: Make some strings GNOME HIG compatible Use header capitalization for menu entries and other improvements. Don't merge before get reviewed. More information: https://developer.gnome.org/hig/guidelines/writing-style.html --- cozy/ui/delete_book_view.py | 2 +- cozy/ui/file_not_found_dialog.py | 6 +++--- cozy/ui/import_failed_dialog.py | 2 +- cozy/ui/widgets/book_element.py | 4 ++-- cozy/ui/widgets/book_row.py | 2 +- cozy/ui/widgets/filter_list_box.py | 2 +- cozy/ui/widgets/storages.py | 4 ++-- data/ui/album_element.blp | 2 +- data/ui/book_detail.blp | 4 ++-- data/ui/book_element.blp | 2 +- data/ui/chapter_element.blp | 2 +- data/ui/headerbar.blp | 10 +++++----- data/ui/main_window.blp | 2 +- data/ui/media_controller.blp | 10 +++++----- data/ui/preferences.blp | 2 +- data/ui/search_page.blp | 4 ++-- data/ui/seek_bar.blp | 6 +++--- data/ui/storage_locations.blp | 6 +++--- data/ui/timer_popover.blp | 2 +- 19 files changed, 37 insertions(+), 37 deletions(-) diff --git a/cozy/ui/delete_book_view.py b/cozy/ui/delete_book_view.py index 4651e22f..8711b6a9 100644 --- a/cozy/ui/delete_book_view.py +++ b/cozy/ui/delete_book_view.py @@ -11,7 +11,7 @@ class DeleteBookView(Adw.AlertDialog): def __init__(self, callback, book: Book): super().__init__( heading=_("Permanently Delete Audiobook?"), - body=_("The audiobook will be permanently deleted from your disk and can not be restored."), + body=_("The audiobook will be permanently deleted from your disk and can not be restored"), default_response="cancel", close_response="cancel", ) diff --git a/cozy/ui/file_not_found_dialog.py b/cozy/ui/file_not_found_dialog.py index 0f4192fb..7909955f 100644 --- a/cozy/ui/file_not_found_dialog.py +++ b/cozy/ui/file_not_found_dialog.py @@ -15,7 +15,7 @@ def __init__(self, chapter: Chapter): self.missing_chapter = chapter super().__init__( - heading=_("File not found"), + heading=_("File Not Found"), body=_("This file could not be found. Do you want to locate it manually?"), default_response="locate", close_response="cancel", @@ -36,10 +36,10 @@ def _on_locate(self, __, response): file_dialog = Gtk.FileDialog(title=_("Locate Missing File")) extension = Path(self.missing_chapter.file).suffix[1:] - current_extension_filter = Gtk.FileFilter(name=_("{ext} files").format(ext=extension)) + current_extension_filter = Gtk.FileFilter(name=_("{ext} Files").format(ext=extension)) current_extension_filter.add_suffix(extension) - audio_files_filter = Gtk.FileFilter(name=_("Audio files")) + audio_files_filter = Gtk.FileFilter(name=_("Audio Files")) audio_files_filter.add_mime_type("audio/*") filters = Gio.ListStore.new(Gtk.FileFilter) diff --git a/cozy/ui/import_failed_dialog.py b/cozy/ui/import_failed_dialog.py index 1cbefca5..8a5a9c75 100644 --- a/cozy/ui/import_failed_dialog.py +++ b/cozy/ui/import_failed_dialog.py @@ -24,7 +24,7 @@ class ImportFailedDialog(Adw.AlertDialog): def __init__(self, files: list[str]): super().__init__( - heading=_("Some files could not be imported"), + heading=_("Some Files Could Not Be Imported"), default_response="cancel", close_response="cancel", ) diff --git a/cozy/ui/widgets/book_element.py b/cozy/ui/widgets/book_element.py index 07b2f71b..57c5a1db 100644 --- a/cozy/ui/widgets/book_element.py +++ b/cozy/ui/widgets/book_element.py @@ -67,10 +67,10 @@ def _create_context_menu(self): menu_model = Gio.Menu() self.install_action("book_element.mark_as_read", None, self._mark_as_read) - menu_model.append(_("Mark as read"), "book_element.mark_as_read") + menu_model.append(_("Mark as Read"), "book_element.mark_as_read") self.install_action("book_element.jump_to_folder", None, self._jump_to_folder) - menu_model.append(_("Open in file browser"), "book_element.jump_to_folder") + menu_model.append(_("Open in File Browser"), "book_element.jump_to_folder") self.install_action("book_element.remove_book", None, self._remove_book) menu_model.append(_("Permanently Deleteā€¦"), "book_element.remove_book") diff --git a/cozy/ui/widgets/book_row.py b/cozy/ui/widgets/book_row.py index 9b88b338..05de63a2 100644 --- a/cozy/ui/widgets/book_row.py +++ b/cozy/ui/widgets/book_row.py @@ -22,7 +22,7 @@ def __init__( if on_click is not None: self.connect("activated", lambda *_: on_click(book)) self.set_activatable(True) - self.set_tooltip_text(_("Play this book")) + self.set_tooltip_text(_("Play This Book")) paintable = self._artwork_cache.get_cover_paintable( book, self.get_scale_factor(), BOOK_ICON_SIZE diff --git a/cozy/ui/widgets/filter_list_box.py b/cozy/ui/widgets/filter_list_box.py index 269238db..13c26af5 100644 --- a/cozy/ui/widgets/filter_list_box.py +++ b/cozy/ui/widgets/filter_list_box.py @@ -14,7 +14,7 @@ def populate(self, elements: list[str]): self.remove_all_children() all_row = ListBoxRowWithData(_("All"), True) - all_row.set_tooltip_text(_("Display all books")) + all_row.set_tooltip_text(_("Display All Books")) self.append(all_row) self.select_row(all_row) diff --git a/cozy/ui/widgets/storages.py b/cozy/ui/widgets/storages.py index a6366929..f60a4001 100644 --- a/cozy/ui/widgets/storages.py +++ b/cozy/ui/widgets/storages.py @@ -62,10 +62,10 @@ def _on_menu_opened(self, *_) -> None: def _set_drive_icon(self) -> None: if self._model.external: self.icon.set_from_icon_name("network-server-symbolic") - self.icon.set_tooltip_text(_("External drive")) + self.icon.set_tooltip_text(_("External Drive")) else: self.icon.set_from_icon_name("folder-open-symbolic") - self.icon.set_tooltip_text(_("Internal drive")) + self.icon.set_tooltip_text(_("Internal Drive")) def _set_default_icon(self) -> None: self.default_icon.set_visible(self._model.default) diff --git a/data/ui/album_element.blp b/data/ui/album_element.blp index 84eeb458..79bdafac 100644 --- a/data/ui/album_element.blp +++ b/data/ui/album_element.blp @@ -37,7 +37,7 @@ template $AlbumElement: Box { height-request: 40; focusable: true; focus-on-click: false; - tooltip-text: _("Start/Stop playback"); + tooltip-text: _("Start/Stop Playback"); halign: center; valign: center; icon-name: 'media-playback-start-symbolic'; diff --git a/data/ui/book_detail.blp b/data/ui/book_detail.blp index 5a1dc1f2..b09c228c 100644 --- a/data/ui/book_detail.blp +++ b/data/ui/book_detail.blp @@ -237,7 +237,7 @@ template $BookDetail: Box { } Box unavailable_box { - tooltip-text: _("Some or all files of this book cannot be found."); + tooltip-text: _("Some or All Files of This Book Cannot Be Found"); halign: center; spacing: 4; @@ -271,7 +271,7 @@ template $BookDetail: Box { receives-default: true; halign: center; icon-name: 'media-playback-start-symbolic'; - tooltip-text: _("Start/Stop playback"); + tooltip-text: _("Start/Stop Playback"); accessibility { label: _("Start or pause the playback"); } diff --git a/data/ui/book_element.blp b/data/ui/book_element.blp index 6b8acea9..212560e3 100644 --- a/data/ui/book_element.blp +++ b/data/ui/book_element.blp @@ -6,7 +6,7 @@ template $BookElement: FlowBoxChild { child: Box container_box { focusable: true; - tooltip-text: _("Open book overview"); + tooltip-text: _("Open Book Overview"); orientation: vertical; spacing: 1; valign: start; diff --git a/data/ui/chapter_element.blp b/data/ui/chapter_element.blp index 298c19f1..69ab79bc 100644 --- a/data/ui/chapter_element.blp +++ b/data/ui/chapter_element.blp @@ -1,7 +1,7 @@ using Gtk 4.0; template $ChapterElement: Box { - tooltip-text: _("Play this part"); + tooltip-text: _("Play This Part"); Box { margin-start: 12; diff --git a/data/ui/headerbar.blp b/data/ui/headerbar.blp index 88f00f14..c42b5263 100644 --- a/data/ui/headerbar.blp +++ b/data/ui/headerbar.blp @@ -19,7 +19,7 @@ template $Headerbar: Box { [end] MenuButton menu_button { - tooltip-text: _("Options"); + tooltip-text: _("Main Menu"); menu-model: primary_menu; icon-name: 'open-menu-symbolic'; @@ -31,7 +31,7 @@ template $Headerbar: Box { [end] ToggleButton search_button { name: 'Search toggle button'; - tooltip-text: _("Search your library"); + tooltip-text: _("Search Your Library"); icon-name: 'loupe-large-symbolic'; accessibility { @@ -43,7 +43,7 @@ template $Headerbar: Box { MenuButton progress_menu_button { visible: false; can-focus: true; - tooltip-text: _("Display background task progress"); + tooltip-text: _("Display Background Task Progress"); Spinner progress_spinner {} @@ -64,7 +64,7 @@ template $Headerbar: Box { SearchEntry search_entry { search-delay: 100; - placeholder-text: _("Start typing..."); + placeholder-text: _("Start typing"); hexpand: true; } } @@ -82,7 +82,7 @@ menu primary_menu { section { item { action: 'app.hide_offline'; - label: _("_Hide unavailable books"); + label: _("_Hide Unavailable Books"); } } diff --git a/data/ui/main_window.blp b/data/ui/main_window.blp index 4a96dc38..be97a34c 100644 --- a/data/ui/main_window.blp +++ b/data/ui/main_window.blp @@ -193,7 +193,7 @@ Adw.ApplicationWindow app_window { } Adw.NavigationPage { - title: _("Book title"); + title: _("Book Title"); tag: 'book_overview'; child: Adw.ToolbarView book_details_container {}; diff --git a/data/ui/media_controller.blp b/data/ui/media_controller.blp index 2fa0ee47..57a0f0bf 100644 --- a/data/ui/media_controller.blp +++ b/data/ui/media_controller.blp @@ -48,7 +48,7 @@ template $MediaController: Adw.BreakpointBin { Box title_box { hexpand: true; - tooltip-text: _("Currently playing"); + tooltip-text: _("Currently Playing"); valign: center; orientation: vertical; spacing: 2; @@ -126,7 +126,7 @@ template $MediaController: Adw.BreakpointBin { height-request: 42; focusable: true; receives-default: true; - tooltip-text: _("Start/Stop playback"); + tooltip-text: _("Start/Stop Playback"); halign: center; valign: center; icon-name: 'media-playback-start-symbolic'; @@ -151,7 +151,7 @@ template $MediaController: Adw.BreakpointBin { icon-name: 'object-rotate-right-symbolic'; accessibility { - label: _("Forward Playback"); + label: _("Forward playback"); } styles [ @@ -175,7 +175,7 @@ template $MediaController: Adw.BreakpointBin { spacing: 3; ScaleButton volume_button { - tooltip-text: _("Volume control"); + tooltip-text: _("Volume Control"); adjustment: Adjustment { lower: 0; @@ -193,7 +193,7 @@ template $MediaController: Adw.BreakpointBin { MenuButton playback_speed_button { focusable: true; receives-default: true; - tooltip-text: _("Playback speed"); + tooltip-text: _("Playback Speed"); icon-name: 'playback-speed-symbolic'; styles [ diff --git a/data/ui/preferences.blp b/data/ui/preferences.blp index 37c9e126..f815b48e 100644 --- a/data/ui/preferences.blp +++ b/data/ui/preferences.blp @@ -108,7 +108,7 @@ template $PreferencesWindow: Adw.PreferencesDialog { title: _("Feedback"); Adw.PreferencesGroup user_feedback_preference_group { - title: _("User feedback"); + title: _("User Feedback"); } } } diff --git a/data/ui/search_page.blp b/data/ui/search_page.blp index b043e990..7e2e3947 100644 --- a/data/ui/search_page.blp +++ b/data/ui/search_page.blp @@ -4,12 +4,12 @@ using Adw 1; template $SearchView: Adw.Bin { Stack stack { Adw.StatusPage start_searching_page { - title: _("Search in your library"); + title: _("Search in Your Library"); icon-name: 'library-symbolic'; } Adw.StatusPage nothing_found_page { - title: _("No results found"); + title: _("No Results Found"); icon-name: 'edit-find-symbolic'; } diff --git a/data/ui/seek_bar.blp b/data/ui/seek_bar.blp index b3cb54e2..39a7a483 100644 --- a/data/ui/seek_bar.blp +++ b/data/ui/seek_bar.blp @@ -12,7 +12,7 @@ template $SeekBar: Box { spacing: 5; Label current_label { - tooltip-text: _("Elapsed time"); + tooltip-text: _("Elapsed Time"); halign: end; valign: center; label: '--:--'; @@ -30,7 +30,7 @@ template $SeekBar: Box { Scale progress_scale { width-request: 150; focusable: true; - tooltip-text: _("Jump to position in current chapter"); + tooltip-text: _("Jump to Position in Current Chapter"); valign: center; hexpand: true; adjustment: seek_bar_adjustment; @@ -46,7 +46,7 @@ template $SeekBar: Box { valign: center; Label remaining_label { - tooltip-text: _("Remaining time"); + tooltip-text: _("Remaining Time"); halign: start; label: '--:--'; single-line-mode: true; diff --git a/data/ui/storage_locations.blp b/data/ui/storage_locations.blp index 2b59a738..e7e2674a 100644 --- a/data/ui/storage_locations.blp +++ b/data/ui/storage_locations.blp @@ -2,7 +2,7 @@ using Gtk 4.0; using Adw 1; template $StorageLocations: Adw.PreferencesGroup { - title: _("Storage locations"); + title: _("Storage Locations"); ListBox storage_locations_list { margin-bottom: 18; @@ -16,14 +16,14 @@ template $StorageLocations: Adw.PreferencesGroup { menu storage_menu { section { item { - label: _("External drive"); + label: _("External Drive"); action: 'storage.mark-external'; } } section { item { - label: _("Set as default"); + label: _("Set as Default"); action: 'storage.make-default'; } diff --git a/data/ui/timer_popover.blp b/data/ui/timer_popover.blp index 0548f4f7..51fa52dd 100644 --- a/data/ui/timer_popover.blp +++ b/data/ui/timer_popover.blp @@ -27,7 +27,7 @@ template $SleepTimer: Popover { Scale timer_scale { width-request: 205; focusable: true; - tooltip-text: _("Timer duration"); + tooltip-text: _("Timer Duration"); halign: start; margin-end: 10; adjustment: timer_value;