Skip to content

Commit

Permalink
draft: test: ui: Make some strings GNOME HIG compatible
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yakushabb committed Apr 26, 2024
1 parent b1626cf commit 1b89db8
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion cozy/ui/delete_book_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
6 changes: 3 additions & 3 deletions cozy/ui/file_not_found_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/import_failed_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
4 changes: 2 additions & 2 deletions cozy/ui/widgets/book_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/widgets/book_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/widgets/filter_list_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions cozy/ui/widgets/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion data/ui/album_element.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions data/ui/book_detail.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion data/ui/book_element.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion data/ui/chapter_element.blp
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
10 changes: 5 additions & 5 deletions data/ui/headerbar.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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 {
Expand All @@ -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 {}

Expand All @@ -64,7 +64,7 @@ template $Headerbar: Box {

SearchEntry search_entry {
search-delay: 100;
placeholder-text: _("Start typing...");
placeholder-text: _("Start typing");
hexpand: true;
}
}
Expand All @@ -82,7 +82,7 @@ menu primary_menu {
section {
item {
action: 'app.hide_offline';
label: _("_Hide unavailable books");
label: _("_Hide Unavailable Books");
}
}

Expand Down
2 changes: 1 addition & 1 deletion data/ui/main_window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down
10 changes: 5 additions & 5 deletions data/ui/media_controller.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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';
Expand All @@ -151,7 +151,7 @@ template $MediaController: Adw.BreakpointBin {
icon-name: 'object-rotate-right-symbolic';

accessibility {
label: _("Forward Playback");
label: _("Forward playback");
}

styles [
Expand All @@ -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;
Expand All @@ -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 [
Expand Down
2 changes: 1 addition & 1 deletion data/ui/preferences.blp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ template $PreferencesWindow: Adw.PreferencesDialog {
title: _("Feedback");

Adw.PreferencesGroup user_feedback_preference_group {
title: _("User feedback");
title: _("User Feedback");
}
}
}
4 changes: 2 additions & 2 deletions data/ui/search_page.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
6 changes: 3 additions & 3 deletions data/ui/seek_bar.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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: '--:--';
Expand All @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions data/ui/storage_locations.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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';
}

Expand Down
2 changes: 1 addition & 1 deletion data/ui/timer_popover.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b89db8

Please sign in to comment.