diff --git a/tagstudio/src/qt/main_window.py b/tagstudio/src/qt/main_window.py index 3de0118d..4d755f05 100644 --- a/tagstudio/src/qt/main_window.py +++ b/tagstudio/src/qt/main_window.py @@ -196,21 +196,21 @@ class Ui_MainWindow(QMainWindow): "MainWindow", u"MainWindow", None)) # Navigation buttons self.backButton.setText( - QCoreApplication.translate("MainWindow", u"<", None)) + QCoreApplication.translate("MainWindow", u"<", None)) #TODO translate self.forwardButton.setText( - QCoreApplication.translate("MainWindow", u">", None)) + QCoreApplication.translate("MainWindow", u">", None)) #TODO translate # Search field self.searchField.setPlaceholderText( - QCoreApplication.translate("MainWindow", u"Search Entries", None)) + QCoreApplication.translate("MainWindow", u"Search Entries", None)) #TODO translate self.searchButton.setText( - QCoreApplication.translate("MainWindow", u"Search", None)) + QCoreApplication.translate("MainWindow", u"Search", None)) #TODO translate self.thumb_size_combobox.setCurrentText("") # Thumbnail size selector self.thumb_size_combobox.setPlaceholderText( - QCoreApplication.translate("MainWindow", u"Thumbnail Size", None)) + QCoreApplication.translate("MainWindow", u"Thumbnail Size", None)) #TODO translate # retranslateUi def moveEvent(self, event) -> None: diff --git a/tagstudio/src/qt/modals/add_field.py b/tagstudio/src/qt/modals/add_field.py index fd0e0c99..5e0a054d 100644 --- a/tagstudio/src/qt/modals/add_field.py +++ b/tagstudio/src/qt/modals/add_field.py @@ -26,7 +26,7 @@ class AddFieldModal(QWidget): super().__init__() self.is_connected = False self.lib = library - self.setWindowTitle("Add Field") + self.setWindowTitle("Add Field") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(400, 300) self.root_layout = QVBoxLayout(self) @@ -40,7 +40,7 @@ class AddFieldModal(QWidget): # 'text-align:center;' "font-weight:bold;" "font-size:14px;" "padding-top: 6px" "" ) - self.title_widget.setText("Add Field") + self.title_widget.setText("Add Field") # TODO translate self.title_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) self.list_widget = QListWidget() @@ -54,13 +54,13 @@ class AddFieldModal(QWidget): # self.cancel_button.setText('Cancel') self.cancel_button = QPushButton() - self.cancel_button.setText("Cancel") + self.cancel_button.setText("Cancel") # TODO translate self.cancel_button.clicked.connect(self.hide) # self.cancel_button.clicked.connect(widget.reset) self.button_layout.addWidget(self.cancel_button) self.save_button = QPushButton() - self.save_button.setText("Add") + self.save_button.setText("Add") # TODO translate # self.save_button.setAutoDefault(True) self.save_button.setDefault(True) self.save_button.clicked.connect(self.hide) diff --git a/tagstudio/src/qt/modals/build_tag.py b/tagstudio/src/qt/modals/build_tag.py index fcb786ae..8e77248d 100644 --- a/tagstudio/src/qt/modals/build_tag.py +++ b/tagstudio/src/qt/modals/build_tag.py @@ -59,7 +59,7 @@ class BuildTagPanel(PanelWidget): self.name_field = QLineEdit() self.name_field.setFixedHeight(24) self.name_field.textChanged.connect(self.on_name_changed) - self.name_field.setPlaceholderText("Tag Name (Required)") + self.name_field.setPlaceholderText("Tag Name (Required)") # TODO translate self.name_layout.addWidget(self.name_field) # Shorthand ------------------------------------------------------------ @@ -70,7 +70,7 @@ class BuildTagPanel(PanelWidget): self.shorthand_layout.setSpacing(0) self.shorthand_layout.setAlignment(Qt.AlignmentFlag.AlignLeft) self.shorthand_title = QLabel() - self.shorthand_title.setText("Shorthand") + self.shorthand_title.setText("Shorthand") # TODO translate self.shorthand_layout.addWidget(self.shorthand_title) self.shorthand_field = QLineEdit() self.shorthand_layout.addWidget(self.shorthand_field) @@ -83,7 +83,7 @@ class BuildTagPanel(PanelWidget): self.aliases_layout.setSpacing(0) self.aliases_layout.setAlignment(Qt.AlignmentFlag.AlignLeft) self.aliases_title = QLabel() - self.aliases_title.setText("Aliases") + self.aliases_title.setText("Aliases") # TODO translate self.aliases_layout.addWidget(self.aliases_title) self.aliases_flow_widget = QWidget() @@ -134,7 +134,7 @@ class BuildTagPanel(PanelWidget): self.subtags_layout.setAlignment(Qt.AlignmentFlag.AlignLeft) self.subtags_title = QLabel() - self.subtags_title.setText("Parent Tags") + self.subtags_title.setText("Parent Tags") # TODO translate self.subtags_layout.addWidget(self.subtags_title) self.subtag_flow_widget = QWidget() @@ -180,7 +180,7 @@ class BuildTagPanel(PanelWidget): tsp = TagSearchPanel(self.lib, exclude_ids) tsp.tag_chosen.connect(lambda x: self.add_subtag_callback(x)) - self.add_tag_modal = PanelModal(tsp, "Add Parent Tags", "Add Parent Tags") + self.add_tag_modal = PanelModal(tsp, "Add Parent Tags", "Add Parent Tags") # TODO translate self.subtags_add_button.clicked.connect(self.add_tag_modal.show) # self.subtags_layout.addWidget(self.subtags_add_button) @@ -196,7 +196,7 @@ class BuildTagPanel(PanelWidget): self.color_layout.setSpacing(0) self.color_layout.setAlignment(Qt.AlignmentFlag.AlignLeft) self.color_title = QLabel() - self.color_title.setText("Color") + self.color_title.setText("Color") # TODO translate self.color_layout.addWidget(self.color_title) self.color_field = QComboBox() self.color_field.setEditable(False) @@ -218,7 +218,7 @@ class BuildTagPanel(PanelWidget): ) ) self.color_layout.addWidget(self.color_field) - remove_selected_alias_action = QAction("remove selected alias", self) + remove_selected_alias_action = QAction("remove selected alias", self) # TODO translate remove_selected_alias_action.triggered.connect(self.remove_selected_alias) remove_selected_alias_action.setShortcut( QtCore.QKeyCombination( @@ -243,7 +243,7 @@ class BuildTagPanel(PanelWidget): self.alias_names: set[str] = set() self.new_alias_names: dict = dict() - self.set_tag(tag or Tag(name="New Tag")) + self.set_tag(tag or Tag(name="New Tag")) # TODO translate if tag is None: self.name_field.selectAll() diff --git a/tagstudio/src/qt/modals/delete_unlinked.py b/tagstudio/src/qt/modals/delete_unlinked.py index b382d083..b1e1605c 100644 --- a/tagstudio/src/qt/modals/delete_unlinked.py +++ b/tagstudio/src/qt/modals/delete_unlinked.py @@ -29,7 +29,7 @@ class DeleteUnlinkedEntriesModal(QWidget): super().__init__() self.driver = driver self.tracker = tracker - self.setWindowTitle("Delete Unlinked Entries") + self.setWindowTitle("Delete Unlinked Entries") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(500, 400) self.root_layout = QVBoxLayout(self) @@ -40,7 +40,7 @@ class DeleteUnlinkedEntriesModal(QWidget): self.desc_widget.setWordWrap(True) self.desc_widget.setText(f""" Are you sure you want to delete the following {self.tracker.missing_files_count} entries? - """) + """) # TODO translate self.desc_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) self.list_view = QListView() @@ -53,13 +53,13 @@ class DeleteUnlinkedEntriesModal(QWidget): self.button_layout.addStretch(1) self.cancel_button = QPushButton() - self.cancel_button.setText("&Cancel") + self.cancel_button.setText("&Cancel") # TODO translate self.cancel_button.setDefault(True) self.cancel_button.clicked.connect(self.hide) self.button_layout.addWidget(self.cancel_button) self.delete_button = QPushButton() - self.delete_button.setText("&Delete") + self.delete_button.setText("&Delete") # TODO translate self.delete_button.clicked.connect(self.hide) self.delete_button.clicked.connect(lambda: self.delete_entries()) self.button_layout.addWidget(self.delete_button) @@ -71,7 +71,7 @@ class DeleteUnlinkedEntriesModal(QWidget): def refresh_list(self): self.desc_widget.setText(f""" Are you sure you want to delete the following {self.tracker.missing_files_count} entries? - """) + """) # TODO translate self.model.clear() for i in self.tracker.missing_files: @@ -81,10 +81,10 @@ class DeleteUnlinkedEntriesModal(QWidget): def delete_entries(self): def displayed_text(x): - return f"Deleting {x}/{self.tracker.missing_files_count} Unlinked Entries" + return f"Deleting {x}/{self.tracker.missing_files_count} Unlinked Entries" # TODO translate pw = ProgressWidget( - window_title="Deleting Entries", + window_title="Deleting Entries", # TODO translate label_text="", cancel_button_text=None, minimum=0, diff --git a/tagstudio/src/qt/modals/drop_import.py b/tagstudio/src/qt/modals/drop_import.py index ec94a3e5..7f4d77e8 100644 --- a/tagstudio/src/qt/modals/drop_import.py +++ b/tagstudio/src/qt/modals/drop_import.py @@ -41,7 +41,7 @@ class DropImportModal(QWidget): self.driver: QtDriver = driver # Widget ====================== - self.setWindowTitle("Conflicting File(s)") + self.setWindowTitle("Conflicting File(s)") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(500, 400) self.root_layout = QVBoxLayout(self) @@ -50,7 +50,9 @@ class DropImportModal(QWidget): self.desc_widget = QLabel() self.desc_widget.setObjectName("descriptionLabel") self.desc_widget.setWordWrap(True) - self.desc_widget.setText("The following files have filenames already exist in the library") + self.desc_widget.setText( + "The following files have filenames already exist in the library" + ) # TODO translate self.desc_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) # Duplicate File List ======== @@ -65,25 +67,25 @@ class DropImportModal(QWidget): self.button_layout.addStretch(1) self.skip_button = QPushButton() - self.skip_button.setText("&Skip") + self.skip_button.setText("&Skip") # TODO translate self.skip_button.setDefault(True) self.skip_button.clicked.connect(lambda: self.begin_transfer(DuplicateChoice.SKIP)) self.button_layout.addWidget(self.skip_button) self.overwrite_button = QPushButton() - self.overwrite_button.setText("&Overwrite") + self.overwrite_button.setText("&Overwrite") # TODO translate self.overwrite_button.clicked.connect( lambda: self.begin_transfer(DuplicateChoice.OVERWRITE) ) self.button_layout.addWidget(self.overwrite_button) self.rename_button = QPushButton() - self.rename_button.setText("&Rename") + self.rename_button.setText("&Rename") # TODO translate self.rename_button.clicked.connect(lambda: self.begin_transfer(DuplicateChoice.RENAME)) self.button_layout.addWidget(self.rename_button) self.cancel_button = QPushButton() - self.cancel_button.setText("&Cancel") + self.cancel_button.setText("&Cancel") # TODO translate self.cancel_button.clicked.connect(lambda: self.begin_transfer(DuplicateChoice.CANCEL)) self.button_layout.addWidget(self.cancel_button) @@ -138,7 +140,7 @@ class DropImportModal(QWidget): """Display the message widgeth with a list of the duplicated files.""" self.desc_widget.setText( f"The following {len(self.duplicate_files)} file(s) have filenames already exist in the library." # noqa: E501 - ) + ) # TODO translate self.model.clear() for dupe in self.duplicate_files: @@ -158,17 +160,15 @@ class DropImportModal(QWidget): return def displayed_text(x): - text = ( - f"Importing New Files...\n{x[0] + 1} File{'s' if x[0] + 1 != 1 else ''} Imported." - ) + text = f"Importing New Files...\n{x[0] + 1} File{'s' if x[0] + 1 != 1 else ''} Imported." # TODO translate if self.choice: text += f" {x[1]} {self.choice.value}" return text pw = ProgressWidget( - window_title="Import Files", - label_text="Importing New Files...", + window_title="Import Files", # TODO translate + label_text="Importing New Files...", # TODO translate cancel_button_text=None, minimum=0, maximum=len(self.files), diff --git a/tagstudio/src/qt/modals/file_extension.py b/tagstudio/src/qt/modals/file_extension.py index 224638ca..19c6f06d 100644 --- a/tagstudio/src/qt/modals/file_extension.py +++ b/tagstudio/src/qt/modals/file_extension.py @@ -35,7 +35,7 @@ class FileExtensionModal(PanelWidget): super().__init__() # Initialize Modal ===================================================== self.lib = library - self.setWindowTitle("File Extensions") + self.setWindowTitle("File Extensions") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(240, 400) self.root_layout = QVBoxLayout(self) @@ -50,7 +50,7 @@ class FileExtensionModal(PanelWidget): # Create "Add Button" Widget ------------------------------------------- self.add_button = QPushButton() - self.add_button.setText("&Add Extension") + self.add_button.setText("&Add Extension") # TODO translate self.add_button.clicked.connect(self.add_item) self.add_button.setDefault(True) self.add_button.setMinimumWidth(100) @@ -61,11 +61,11 @@ class FileExtensionModal(PanelWidget): self.mode_layout.setContentsMargins(0, 0, 0, 0) self.mode_layout.setSpacing(12) self.mode_label = QLabel() - self.mode_label.setText("List Mode:") + self.mode_label.setText("List Mode:") # TODO translate self.mode_combobox = QComboBox() self.mode_combobox.setEditable(False) - self.mode_combobox.addItem("Include") - self.mode_combobox.addItem("Exclude") + self.mode_combobox.addItem("Include") # TODO translate + self.mode_combobox.addItem("Exclude") # TODO translate is_exclude_list = int(bool(self.lib.prefs(LibraryPrefs.IS_EXCLUDE_LIST))) diff --git a/tagstudio/src/qt/modals/fix_dupes.py b/tagstudio/src/qt/modals/fix_dupes.py index fccdb5bc..0476e644 100644 --- a/tagstudio/src/qt/modals/fix_dupes.py +++ b/tagstudio/src/qt/modals/fix_dupes.py @@ -30,7 +30,7 @@ class FixDupeFilesModal(QWidget): self.driver = driver self.count = -1 self.filename = "" - self.setWindowTitle("Fix Duplicate Files") + self.setWindowTitle("Fix Duplicate Files") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(400, 300) self.root_layout = QVBoxLayout(self) @@ -44,7 +44,7 @@ class FixDupeFilesModal(QWidget): self.desc_widget.setStyleSheet("text-align:left;") self.desc_widget.setText( "TagStudio supports importing DupeGuru results to manage duplicate files." - ) + ) # TODO translate self.desc_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) self.dupe_count = QLabel() @@ -54,24 +54,24 @@ class FixDupeFilesModal(QWidget): self.file_label = QLabel() self.file_label.setObjectName("fileLabel") - self.file_label.setText("No DupeGuru File Selected") + self.file_label.setText("No DupeGuru File Selected") # TODO translate self.open_button = QPushButton() - self.open_button.setText("&Load DupeGuru File") + self.open_button.setText("&Load DupeGuru File") # TODO translate self.open_button.clicked.connect(self.select_file) self.mirror_modal = MirrorEntriesModal(self.driver, self.tracker) self.mirror_modal.done.connect(self.refresh_dupes) self.mirror_button = QPushButton() - self.mirror_button.setText("&Mirror Entries") + self.mirror_button.setText("&Mirror Entries") # TODO translate self.mirror_button.clicked.connect(self.mirror_modal.show) self.mirror_desc = QLabel() self.mirror_desc.setWordWrap(True) self.mirror_desc.setText( "Mirror the Entry data across each duplicate match set, combining all data while not " "removing or duplicating fields. This operation will not delete any files or data." - ) + ) # TODO translate self.advice_label = QLabel() self.advice_label.setWordWrap(True) @@ -80,7 +80,7 @@ class FixDupeFilesModal(QWidget): "After mirroring, you're free to use DupeGuru to delete the unwanted files. " "Afterwards, use TagStudio's \"Fix Unlinked Entries\" feature in the " "Tools menu in order to delete the unlinked Entries." - ) + )# TODO translate # fmt: on self.button_container = QWidget() @@ -89,7 +89,7 @@ class FixDupeFilesModal(QWidget): self.button_layout.addStretch(1) self.done_button = QPushButton() - self.done_button.setText("&Done") + self.done_button.setText("&Done") # TODO translate self.done_button.setDefault(True) self.done_button.clicked.connect(self.hide) self.button_layout.addWidget(self.done_button) @@ -108,9 +108,11 @@ class FixDupeFilesModal(QWidget): self.set_dupe_count(-1) def select_file(self): - qfd = QFileDialog(self, "Open DupeGuru Results File", str(self.lib.library_dir)) + qfd = QFileDialog( + self, "Open DupeGuru Results File", str(self.lib.library_dir) + ) # TODO translate qfd.setFileMode(QFileDialog.FileMode.ExistingFile) - qfd.setNameFilter("DupeGuru Files (*.dupeguru)") + qfd.setNameFilter("DupeGuru Files (*.dupeguru)") # TODO translate if qfd.exec_(): filename = qfd.selectedFiles() if filename: @@ -120,7 +122,7 @@ class FixDupeFilesModal(QWidget): if filename: self.file_label.setText(filename) else: - self.file_label.setText("No DupeGuru File Selected") + self.file_label.setText("No DupeGuru File Selected") # TODO translate self.filename = filename self.refresh_dupes() self.mirror_modal.refresh_list() @@ -132,10 +134,10 @@ class FixDupeFilesModal(QWidget): def set_dupe_count(self, count: int): if count < 0: self.mirror_button.setDisabled(True) - self.dupe_count.setText("Duplicate File Matches: N/A") + self.dupe_count.setText("Duplicate File Matches: N/A") # TODO translate elif count == 0: self.mirror_button.setDisabled(True) - self.dupe_count.setText(f"Duplicate File Matches: {count}") + self.dupe_count.setText(f"Duplicate File Matches: {count}") # TODO translate else: self.mirror_button.setDisabled(False) - self.dupe_count.setText(f"Duplicate File Matches: {count}") + self.dupe_count.setText(f"Duplicate File Matches: {count}") # TODO translate diff --git a/tagstudio/src/qt/modals/fix_unlinked.py b/tagstudio/src/qt/modals/fix_unlinked.py index 7c580d3f..2afae7fb 100644 --- a/tagstudio/src/qt/modals/fix_unlinked.py +++ b/tagstudio/src/qt/modals/fix_unlinked.py @@ -29,7 +29,7 @@ class FixUnlinkedEntriesModal(QWidget): self.missing_count = -1 self.dupe_count = -1 - self.setWindowTitle("Fix Unlinked Entries") + self.setWindowTitle("Fix Unlinked Entries") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(400, 300) self.root_layout = QVBoxLayout(self) @@ -45,7 +45,7 @@ class FixUnlinkedEntriesModal(QWidget): "it is then considered unlinked.\n\n" "Unlinked entries may be automatically relinked via searching your directories, " "manually relinked by the user, or deleted if desired." - ) + ) # TODO translate self.missing_count_label = QLabel() self.missing_count_label.setObjectName("missingCountLabel") @@ -58,14 +58,14 @@ class FixUnlinkedEntriesModal(QWidget): self.dupe_count_label.setAlignment(Qt.AlignmentFlag.AlignCenter) self.refresh_unlinked_button = QPushButton() - self.refresh_unlinked_button.setText("&Refresh All") + self.refresh_unlinked_button.setText("&Refresh All") # TODO translate self.refresh_unlinked_button.clicked.connect(self.refresh_missing_files) self.merge_class = MergeDuplicateEntries(self.lib, self.driver) self.relink_class = RelinkUnlinkedEntries(self.tracker) self.search_button = QPushButton() - self.search_button.setText("&Search && Relink") + self.search_button.setText("&Search && Relink") # TODO translate self.relink_class.done.connect( # refresh the grid lambda: ( @@ -76,7 +76,7 @@ class FixUnlinkedEntriesModal(QWidget): self.search_button.clicked.connect(self.relink_class.repair_entries) self.manual_button = QPushButton() - self.manual_button.setText("&Manual Relink") + self.manual_button.setText("&Manual Relink") # TODO translate self.manual_button.setHidden(True) self.delete_button = QPushButton() @@ -88,7 +88,7 @@ class FixUnlinkedEntriesModal(QWidget): self.driver.filter_items(), ) ) - self.delete_button.setText("De&lete Unlinked Entries") + self.delete_button.setText("De&lete Unlinked Entries") # TODO translate self.delete_button.clicked.connect(self.delete_modal.show) self.button_container = QWidget() @@ -97,7 +97,7 @@ class FixUnlinkedEntriesModal(QWidget): self.button_layout.addStretch(1) self.done_button = QPushButton() - self.done_button.setText("&Done") + self.done_button.setText("&Done") # TODO translate self.done_button.setDefault(True) self.done_button.clicked.connect(self.hide) self.button_layout.addWidget(self.done_button) @@ -116,8 +116,8 @@ class FixUnlinkedEntriesModal(QWidget): def refresh_missing_files(self): pw = ProgressWidget( - window_title="Scanning Library", - label_text="Scanning Library for Unlinked Entries...", + window_title="Scanning Library", # TODO translate + label_text="Scanning Library for Unlinked Entries...", # TODO translate cancel_button_text=None, minimum=0, maximum=self.lib.entries_count, @@ -139,9 +139,11 @@ class FixUnlinkedEntriesModal(QWidget): if self.missing_count < 0: self.search_button.setDisabled(True) self.delete_button.setDisabled(True) - self.missing_count_label.setText("Unlinked Entries: N/A") + self.missing_count_label.setText("Unlinked Entries: N/A") # TODO translate else: # disable buttons if there are no files to fix self.search_button.setDisabled(self.missing_count == 0) self.delete_button.setDisabled(self.missing_count == 0) - self.missing_count_label.setText(f"Unlinked Entries: {self.missing_count}") + self.missing_count_label.setText( + f"Unlinked Entries: {self.missing_count}" + ) # TODO translate diff --git a/tagstudio/src/qt/modals/folders_to_tags.py b/tagstudio/src/qt/modals/folders_to_tags.py index f9962a0e..ca2d48cc 100644 --- a/tagstudio/src/qt/modals/folders_to_tags.py +++ b/tagstudio/src/qt/modals/folders_to_tags.py @@ -164,7 +164,7 @@ class FoldersToTagsModal(QWidget): self.count = -1 self.filename = "" - self.setWindowTitle("Create Tags From Folders") + self.setWindowTitle("Create Tags From Folders") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(640, 640) self.root_layout = QVBoxLayout(self) @@ -174,7 +174,7 @@ class FoldersToTagsModal(QWidget): self.title_widget.setObjectName("title") self.title_widget.setWordWrap(True) self.title_widget.setStyleSheet("font-weight:bold;" "font-size:14px;" "padding-top: 6px") - self.title_widget.setText("Create Tags From Folders") + self.title_widget.setText("Create Tags From Folders") # TODO translate self.title_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) self.desc_widget = QLabel() @@ -190,10 +190,10 @@ class FoldersToTagsModal(QWidget): self.open_close_button_layout = QHBoxLayout(self.open_close_button_w) self.open_all_button = QPushButton() - self.open_all_button.setText("Open All") + self.open_all_button.setText("Open All") # TODO translate self.open_all_button.clicked.connect(lambda: self.set_all_branches(False)) self.close_all_button = QPushButton() - self.close_all_button.setText("Close All") + self.close_all_button.setText("Close All") # TODO translate self.close_all_button.clicked.connect(lambda: self.set_all_branches(True)) self.open_close_button_layout.addWidget(self.open_all_button) @@ -212,7 +212,7 @@ class FoldersToTagsModal(QWidget): self.scroll_area.setWidget(self.scroll_contents) self.apply_button = QPushButton() - self.apply_button.setText("&Apply") + self.apply_button.setText("&Apply") # TODO translate self.apply_button.setMinimumWidth(100) self.apply_button.clicked.connect(self.on_apply) diff --git a/tagstudio/src/qt/modals/merge_dupe_entries.py b/tagstudio/src/qt/modals/merge_dupe_entries.py index 66c94dda..14891d47 100644 --- a/tagstudio/src/qt/modals/merge_dupe_entries.py +++ b/tagstudio/src/qt/modals/merge_dupe_entries.py @@ -25,8 +25,8 @@ class MergeDuplicateEntries(QObject): def merge_entries(self): pw = ProgressWidget( - window_title="Merging Duplicate Entries", - label_text="Merging Duplicate Entries...", + window_title="Merging Duplicate Entries", # TODO translate + label_text="Merging Duplicate Entries...", # TODO translate cancel_button_text=None, minimum=0, maximum=self.tracker.groups_count, diff --git a/tagstudio/src/qt/modals/mirror_entities.py b/tagstudio/src/qt/modals/mirror_entities.py index 6ab19957..4c0cd4aa 100644 --- a/tagstudio/src/qt/modals/mirror_entities.py +++ b/tagstudio/src/qt/modals/mirror_entities.py @@ -30,7 +30,7 @@ class MirrorEntriesModal(QWidget): def __init__(self, driver: "QtDriver", tracker: DupeRegistry): super().__init__() self.driver = driver - self.setWindowTitle("Mirror Entries") + self.setWindowTitle("Mirror Entries") # TODO translate self.setWindowModality(Qt.WindowModality.ApplicationModal) self.setMinimumSize(500, 400) self.root_layout = QVBoxLayout(self) @@ -43,7 +43,7 @@ class MirrorEntriesModal(QWidget): self.desc_widget.setText(f""" Are you sure you want to mirror the following {self.tracker.groups_count} Entries? - """) + """) # TODO translate self.desc_widget.setAlignment(Qt.AlignmentFlag.AlignCenter) self.list_view = QListView() @@ -56,13 +56,13 @@ class MirrorEntriesModal(QWidget): self.button_layout.addStretch(1) self.cancel_button = QPushButton() - self.cancel_button.setText("&Cancel") + self.cancel_button.setText("&Cancel") # TODO translate self.cancel_button.setDefault(True) self.cancel_button.clicked.connect(self.hide) self.button_layout.addWidget(self.cancel_button) self.mirror_button = QPushButton() - self.mirror_button.setText("&Mirror") + self.mirror_button.setText("&Mirror") # TODO translate self.mirror_button.clicked.connect(self.hide) self.mirror_button.clicked.connect(self.mirror_entries) self.button_layout.addWidget(self.mirror_button) @@ -82,10 +82,10 @@ class MirrorEntriesModal(QWidget): def mirror_entries(self): def displayed_text(x): - return f"Mirroring {x + 1}/{self.tracker.groups_count} Entries..." + return f"Mirroring {x + 1}/{self.tracker.groups_count} Entries..." # TODO translate pw = ProgressWidget( - window_title="Mirroring Entries", + window_title="Mirroring Entries", # TODO translate label_text="", cancel_button_text=None, minimum=0, diff --git a/tagstudio/src/qt/modals/relink_unlinked.py b/tagstudio/src/qt/modals/relink_unlinked.py index ab2a1d40..87d67a6c 100644 --- a/tagstudio/src/qt/modals/relink_unlinked.py +++ b/tagstudio/src/qt/modals/relink_unlinked.py @@ -17,12 +17,12 @@ class RelinkUnlinkedEntries(QObject): def repair_entries(self): def displayed_text(x): - text = f"Attempting to Relink {x}/{self.tracker.missing_files_count} Entries. \n" - text += f"{self.tracker.files_fixed_count} Successfully Relinked." + text = f"Attempting to Relink {x}/{self.tracker.missing_files_count} Entries. \n" # TODO translate + text += f"{self.tracker.files_fixed_count} Successfully Relinked." # TODO translate return text pw = ProgressWidget( - window_title="Relinking Entries", + window_title="Relinking Entries", # TODO translate label_text="", cancel_button_text=None, minimum=0, diff --git a/tagstudio/src/qt/modals/tag_database.py b/tagstudio/src/qt/modals/tag_database.py index 168420d5..15f6289e 100644 --- a/tagstudio/src/qt/modals/tag_database.py +++ b/tagstudio/src/qt/modals/tag_database.py @@ -44,7 +44,7 @@ class TagDatabasePanel(PanelWidget): self.search_field = QLineEdit() self.search_field.setObjectName("searchField") self.search_field.setMinimumSize(QSize(0, 32)) - self.search_field.setPlaceholderText("Search Tags") + self.search_field.setPlaceholderText("Search Tags") # TODO translate self.search_field.textEdited.connect(lambda: self.update_tags(self.search_field.text())) self.search_field.returnPressed.connect( lambda checked=False: self.on_return(self.search_field.text()) @@ -63,7 +63,7 @@ class TagDatabasePanel(PanelWidget): self.scroll_area.setWidget(self.scroll_contents) self.create_tag_button = QPushButton() - self.create_tag_button.setText("Create Tag") + self.create_tag_button.setText("Create Tag") # TODO translate self.create_tag_button.clicked.connect(self.build_tag) self.root_layout.addWidget(self.search_field) @@ -74,8 +74,8 @@ class TagDatabasePanel(PanelWidget): def build_tag(self): self.modal = PanelModal( BuildTagPanel(self.lib), - "New Tag", - "Add Tag", + "New Tag", # TODO translate + "Add Tag", # TODO translate has_save=True, ) @@ -134,8 +134,10 @@ class TagDatabasePanel(PanelWidget): return message_box = QMessageBox() - message_box.setWindowTitle("Remove Tag") - message_box.setText(f'Are you sure you want to delete the tag "{tag.name}"?') + message_box.setWindowTitle("Remove Tag") # TODO translate + message_box.setText( + f'Are you sure you want to delete the tag "{tag.name}"?' + ) # TODO translate message_box.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) # type: ignore message_box.setIcon(QMessageBox.Question) # type: ignore @@ -156,7 +158,7 @@ class TagDatabasePanel(PanelWidget): self.edit_modal = PanelModal( build_tag_panel, tag.name, - "Edit Tag", + "Edit Tag", # TODO translate done_callback=(self.update_tags(self.search_field.text())), has_save=True, ) diff --git a/tagstudio/src/qt/modals/tag_search.py b/tagstudio/src/qt/modals/tag_search.py index 72f3650b..2189b316 100644 --- a/tagstudio/src/qt/modals/tag_search.py +++ b/tagstudio/src/qt/modals/tag_search.py @@ -41,7 +41,7 @@ class TagSearchPanel(PanelWidget): self.search_field = QLineEdit() self.search_field.setObjectName("searchField") self.search_field.setMinimumSize(QSize(0, 32)) - self.search_field.setPlaceholderText("Search Tags") + self.search_field.setPlaceholderText("Search Tags") # TODO translate self.search_field.textEdited.connect(lambda: self.update_tags(self.search_field.text())) self.search_field.returnPressed.connect( lambda checked=False: self.on_return(self.search_field.text()) diff --git a/tagstudio/src/qt/platform_strings.py b/tagstudio/src/qt/platform_strings.py index 9eda3ef8..7131da89 100644 --- a/tagstudio/src/qt/platform_strings.py +++ b/tagstudio/src/qt/platform_strings.py @@ -11,6 +11,6 @@ class PlatformStrings: open_file_str: str = "Open in file explorer" if platform.system() == "Windows": - open_file_str = "Open in Explorer" + open_file_str = "Open in Explorer" # TODO translate elif platform.system() == "Darwin": - open_file_str = "Reveal in Finder" + open_file_str = "Reveal in Finder" # TODO translate diff --git a/tagstudio/src/qt/ui/home_ui.py b/tagstudio/src/qt/ui/home_ui.py index 0d986f6a..3474f957 100644 --- a/tagstudio/src/qt/ui/home_ui.py +++ b/tagstudio/src/qt/ui/home_ui.py @@ -147,14 +147,14 @@ class Ui_MainWindow(object): def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) - self.comboBox_2.setItemText(0, QCoreApplication.translate("MainWindow", u"And (includes all tags)", None)) - self.comboBox_2.setItemText(1, QCoreApplication.translate("MainWindow", u"Or (includes any tag)", None)) + self.comboBox_2.setItemText(0, QCoreApplication.translate("MainWindow", u"And (includes all tags)", None)) # TODO remove? + self.comboBox_2.setItemText(1, QCoreApplication.translate("MainWindow", u"Or (includes any tag)", None)) # TODO remove? self.comboBox.setCurrentText("") - self.comboBox.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Thumbnail Size", None)) + self.comboBox.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Thumbnail Size", None)) # TODO translate? self.backButton.setText(QCoreApplication.translate("MainWindow", u"<", None)) self.forwardButton.setText(QCoreApplication.translate("MainWindow", u">", None)) - self.searchField.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Search Entries", None)) + self.searchField.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Search Entries", None)) # TODO translate? self.searchButton.setText(QCoreApplication.translate("MainWindow", u"Search", None)) # retranslateUi diff --git a/tagstudio/src/qt/widgets/item_thumb.py b/tagstudio/src/qt/widgets/item_thumb.py index 9935fe4e..48ea0dbd 100644 --- a/tagstudio/src/qt/widgets/item_thumb.py +++ b/tagstudio/src/qt/widgets/item_thumb.py @@ -217,7 +217,7 @@ class ItemThumb(FlowWidget): self.thumb_button.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu) self.opener = FileOpenerHelper("") - open_file_action = QAction("Open file", self) + open_file_action = QAction("Open file", self) # TODO translate open_file_action.triggered.connect(self.opener.open_file) open_explorer_action = QAction(PlatformStrings.open_file_str, self) open_explorer_action.triggered.connect(self.opener.open_explorer) @@ -306,7 +306,7 @@ class ItemThumb(FlowWidget): self.cb_layout.addWidget(badge) # Filename Label ======================================================= - self.file_label = QLabel(text="Filename") + self.file_label = QLabel(text="Filename") # TODO translate self.file_label.setStyleSheet(ItemThumb.filename_style) self.file_label.setMaximumHeight(self.label_height) if not show_filename_label: diff --git a/tagstudio/src/qt/widgets/landing.py b/tagstudio/src/qt/widgets/landing.py index c1a5a7d8..935268ef 100644 --- a/tagstudio/src/qt/widgets/landing.py +++ b/tagstudio/src/qt/widgets/landing.py @@ -62,7 +62,7 @@ class LandingWidget(QWidget): open_shortcut_text = "(Ctrl+O)" self.open_button: QPushButton = QPushButton() self.open_button.setMinimumWidth(200) - self.open_button.setText(f"Open/Create Library {open_shortcut_text}") + self.open_button.setText(f"Open/Create Library {open_shortcut_text}") # TODO translate self.open_button.clicked.connect(self.driver.open_library_from_dialog) # Create status label -------------------------------------------------- diff --git a/tagstudio/src/qt/widgets/migration_modal.py b/tagstudio/src/qt/widgets/migration_modal.py index a2978f56..2bf13a95 100644 --- a/tagstudio/src/qt/widgets/migration_modal.py +++ b/tagstudio/src/qt/widgets/migration_modal.py @@ -54,7 +54,7 @@ class JsonMigrationModal(QObject): self.is_migration_initialized: bool = False self.discrepancies: list[str] = [] - self.title: str = f'Save Format Migration: "{self.path}"' + self.title: str = f'Save Format Migration: "{self.path}"' # TODO translate self.warning: str = "(!)" self.old_entry_count: int = 0 @@ -77,7 +77,7 @@ class JsonMigrationModal(QObject): def init_page_info(self) -> None: """Initialize the migration info page.""" body_wrapper: PagedBodyWrapper = PagedBodyWrapper() - body_label: QLabel = QLabel( + body_label: QLabel = QLabel( # TODO translate "Library save files created with TagStudio versions 9.4 and below will " "need to be migrated to the new v9.5+ format." "
" @@ -93,8 +93,8 @@ class JsonMigrationModal(QObject): body_wrapper.layout().addWidget(body_label) body_wrapper.layout().setContentsMargins(0, 36, 0, 0) - cancel_button: QPushButtonWrapper = QPushButtonWrapper("Cancel") - next_button: QPushButtonWrapper = QPushButtonWrapper("Continue") + cancel_button: QPushButtonWrapper = QPushButtonWrapper("Cancel") # TODO translate + next_button: QPushButtonWrapper = QPushButtonWrapper("Continue") # TODO translate cancel_button.clicked.connect(self.migration_cancelled.emit) self.stack.append( @@ -115,18 +115,18 @@ class JsonMigrationModal(QObject): body_container_layout.setContentsMargins(0, 0, 0, 0) tab: str = " " - self.match_text: str = "Matched" - self.differ_text: str = "Discrepancy" + self.match_text: str = "Matched" # TODO translate + self.differ_text: str = "Discrepancy" # TODO translate - entries_text: str = "Entries:" - tags_text: str = "Tags:" - shorthand_text: str = tab + "Shorthands:" - subtags_text: str = tab + "Parent Tags:" - aliases_text: str = tab + "Aliases:" - colors_text: str = tab + "Colors:" - ext_text: str = "File Extension List:" - ext_type_text: str = "Extension List Type:" - desc_text: str = ( + entries_text: str = "Entries:" # TODO translate + tags_text: str = "Tags:" # TODO translate + shorthand_text: str = tab + "Shorthands:" # TODO translate + subtags_text: str = tab + "Parent Tags:" # TODO translate + aliases_text: str = tab + "Aliases:" # TODO translate + colors_text: str = tab + "Colors:" # TODO translate + ext_text: str = "File Extension List:" # TODO translate + ext_type_text: str = "Extension List Type:" # TODO translate + desc_text: str = ( # TODO translate "
Start and preview the results of the library migration process. " 'The converted library will not be used unless you click "Finish Migration". ' "

" @@ -137,8 +137,8 @@ class JsonMigrationModal(QObject): "This process may take up to several minutes for larger libraries." "" ) - path_parity_text: str = tab + "Paths:" - field_parity_text: str = tab + "Fields:" + path_parity_text: str = tab + "Paths:" # TODO translate + field_parity_text: str = tab + "Fields:" # TODO translate self.entries_row: int = 0 self.path_row: int = 1 @@ -153,7 +153,7 @@ class JsonMigrationModal(QObject): old_lib_container: QWidget = QWidget() old_lib_layout: QVBoxLayout = QVBoxLayout(old_lib_container) - old_lib_title: QLabel = QLabel("

v9.4 Library

") + old_lib_title: QLabel = QLabel("

v9.4 Library

") # TODO translate old_lib_title.setAlignment(Qt.AlignmentFlag.AlignCenter) old_lib_layout.addWidget(old_lib_title) @@ -215,7 +215,7 @@ class JsonMigrationModal(QObject): new_lib_container: QWidget = QWidget() new_lib_layout: QVBoxLayout = QVBoxLayout(new_lib_container) - new_lib_title: QLabel = QLabel("

v9.5+ Library

") + new_lib_title: QLabel = QLabel("

v9.5+ Library

") # TODO translate new_lib_title.setAlignment(Qt.AlignmentFlag.AlignCenter) new_lib_layout.addWidget(new_lib_title) @@ -291,13 +291,13 @@ class JsonMigrationModal(QObject): self.body_wrapper_01.layout().addWidget(desc_label) self.body_wrapper_01.layout().setSpacing(12) - back_button: QPushButtonWrapper = QPushButtonWrapper("Back") - start_button: QPushButtonWrapper = QPushButtonWrapper("Start and Preview") + back_button: QPushButtonWrapper = QPushButtonWrapper("Back") # TODO translate + start_button: QPushButtonWrapper = QPushButtonWrapper("Start and Preview") # TODO translate start_button.setMinimumWidth(120) start_button.clicked.connect(self.migrate) start_button.clicked.connect(lambda: finish_button.setDisabled(False)) start_button.clicked.connect(lambda: start_button.setDisabled(True)) - finish_button: QPushButtonWrapper = QPushButtonWrapper("Finish Migration") + finish_button: QPushButtonWrapper = QPushButtonWrapper("Finish Migration") # TODO translate finish_button.setMinimumWidth(120) finish_button.setDisabled(True) finish_button.clicked.connect(self.finish_migration) @@ -348,9 +348,9 @@ class JsonMigrationModal(QObject): lambda x: ( pb.setLabelText(f"

{x}

"), self.update_sql_value_ui(show_msg_box=False) - if x == "Checking for Parity..." + if x == "Checking for Parity..." # TODO translate else (), - self.update_parity_ui() if x == "Checking for Parity..." else (), + self.update_parity_ui() if x == "Checking for Parity..." else (), # TODO translate ) ) r = CustomRunnable(iterator.run) @@ -367,21 +367,23 @@ class JsonMigrationModal(QObject): """Iterate over the library migration process.""" try: # Convert JSON Library to SQLite - yield "Creating SQL Database Tables..." + yield "Creating SQL Database Tables..." # TODO translate self.sql_lib = SqliteLibrary() self.temp_path: Path = ( self.json_lib.library_dir / TS_FOLDER_NAME / "migration_ts_library.sqlite" ) self.sql_lib.storage_path = self.temp_path if self.temp_path.exists(): - logger.info('Temporary migration file "temp_path" already exists. Removing...') + logger.info( + 'Temporary migration file "temp_path" already exists. Removing...' + ) # TODO translate self.temp_path.unlink() self.sql_lib.open_sqlite_library( self.json_lib.library_dir, is_new=True, add_default_data=False ) - yield f"Migrating {len(self.json_lib.entries):,d} File Entries..." + yield f"Migrating {len(self.json_lib.entries):,d} File Entries..." # TODO translate self.sql_lib.migrate_json_to_sqlite(self.json_lib) - yield "Checking for Parity..." + yield "Checking for Parity..." # TODO translate check_set = set() check_set.add(self.check_field_parity()) check_set.add(self.check_path_parity()) @@ -391,9 +393,9 @@ class JsonMigrationModal(QObject): check_set.add(self.check_color_parity()) self.update_parity_ui() if False not in check_set: - yield "Migration Complete!" + yield "Migration Complete!" # TODO translate else: - yield "Migration Complete, Discrepancies Found" + yield "Migration Complete, Discrepancies Found" # TODO translate self.done = True except Exception as e: @@ -432,16 +434,16 @@ class JsonMigrationModal(QObject): self.sql_lib.prefs(LibraryPrefs.IS_EXCLUDE_LIST), self.old_ext_type, ) - logger.info("Parity check complete!") + logger.info("Parity check complete!") # TODO translate if self.discrepancies: - logger.warning("Discrepancies found:") + logger.warning("Discrepancies found:") # TODO translate logger.warning("\n".join(self.discrepancies)) QApplication.beep() if not show_msg_box: return msg_box = QMessageBox() - msg_box.setWindowTitle("Library Discrepancies Found") - msg_box.setText( + msg_box.setWindowTitle("Library Discrepancies Found") # TODO translate + msg_box.setText( # TODO translate "Discrepancies were found between the original and converted library formats. " "Please review and choose to whether continue with the migration or to cancel." ) @@ -546,7 +548,7 @@ class JsonMigrationModal(QObject): "[Field Comparison]", message=f"NEW (SQL): SQL Entry ID mismatch: {json_entry.id+1}", ) - self.discrepancies.append( + self.discrepancies.append( # TODO translate f"[Field Comparison]:\nNEW (SQL): SQL Entry ID not found: {json_entry.id+1}" ) self.field_parity = False @@ -624,7 +626,7 @@ class JsonMigrationModal(QObject): and sql_fields is not None and (json_fields == sql_fields) ): - self.discrepancies.append( + self.discrepancies.append( # TODO translate f"[Field Comparison]:\nOLD (JSON):{json_fields}\nNEW (SQL):{sql_fields}" ) self.field_parity = False @@ -676,7 +678,7 @@ class JsonMigrationModal(QObject): and json_subtags is not None and (sql_subtags == json_subtags) ): - self.discrepancies.append( + self.discrepancies.append( # TODO translate f"[Subtag Parity]:\nOLD (JSON):{json_subtags}\nNEW (SQL):{sql_subtags}" ) self.subtag_parity = False @@ -712,7 +714,7 @@ class JsonMigrationModal(QObject): and json_aliases is not None and (sql_aliases == json_aliases) ): - self.discrepancies.append( + self.discrepancies.append( # TODO translate f"[Alias Parity]:\nOLD (JSON):{json_aliases}\nNEW (SQL):{sql_aliases}" ) self.alias_parity = False @@ -743,7 +745,7 @@ class JsonMigrationModal(QObject): and json_shorthand is not None and (sql_shorthand == json_shorthand) ): - self.discrepancies.append( + self.discrepancies.append( # TODO translate f"[Shorthand Parity]:\nOLD (JSON):{json_shorthand}\nNEW (SQL):{sql_shorthand}" ) self.shorthand_parity = False @@ -774,7 +776,7 @@ class JsonMigrationModal(QObject): ) if not (sql_color is not None and json_color is not None and (sql_color == json_color)): - self.discrepancies.append( + self.discrepancies.append( # TODO translate f"[Color Parity]:\nOLD (JSON):{json_color}\nNEW (SQL):{sql_color}" ) self.color_parity = False diff --git a/tagstudio/src/qt/widgets/panel.py b/tagstudio/src/qt/widgets/panel.py index d18efb34..59e2234c 100755 --- a/tagstudio/src/qt/widgets/panel.py +++ b/tagstudio/src/qt/widgets/panel.py @@ -49,7 +49,7 @@ class PanelModal(QWidget): if not (save_callback or has_save): self.done_button = QPushButton() - self.done_button.setText("Done") + self.done_button.setText("Done") # TODO translate self.done_button.setAutoDefault(True) self.done_button.clicked.connect(self.hide) if done_callback: @@ -59,7 +59,7 @@ class PanelModal(QWidget): if save_callback or has_save: self.cancel_button = QPushButton() - self.cancel_button.setText("Cancel") + self.cancel_button.setText("Cancel") # TODO translate self.cancel_button.clicked.connect(self.hide) self.cancel_button.clicked.connect(widget.reset) # self.cancel_button.clicked.connect(cancel_callback) @@ -67,7 +67,7 @@ class PanelModal(QWidget): self.button_layout.addWidget(self.cancel_button) self.save_button = QPushButton() - self.save_button.setText("Save") + self.save_button.setText("Save") # TODO translate self.save_button.setAutoDefault(True) self.save_button.clicked.connect(self.hide) self.save_button.clicked.connect(self.saved.emit) diff --git a/tagstudio/src/qt/widgets/preview_panel.py b/tagstudio/src/qt/widgets/preview_panel.py index 7e8e0c8b..50ed0842 100644 --- a/tagstudio/src/qt/widgets/preview_panel.py +++ b/tagstudio/src/qt/widgets/preview_panel.py @@ -119,7 +119,7 @@ class PreviewPanel(QWidget): ) date_style = "font-size:12px;" - self.open_file_action = QAction("Open file", self) + self.open_file_action = QAction("Open file", self) # TODO translate self.open_explorer_action = QAction(PlatformStrings.open_file_str, self) self.preview_img = QPushButtonWrapper() @@ -279,7 +279,7 @@ class PreviewPanel(QWidget): self.add_field_button.setCursor(Qt.CursorShape.PointingHandCursor) self.add_field_button.setMinimumSize(96, 28) self.add_field_button.setMaximumSize(96, 28) - self.add_field_button.setText("Add Field") + self.add_field_button.setText("Add Field") # TODO translate self.afb_layout.addWidget(self.add_field_button) self.add_field_modal = AddFieldModal(self.lib) self.place_add_field_button() @@ -303,7 +303,7 @@ class PreviewPanel(QWidget): self.driver.frame_content[grid_idx] = result def remove_field_prompt(self, name: str) -> str: - return f'Are you sure you want to remove field "{name}"?' + return f'Are you sure you want to remove field "{name}"?' # TODO translate def fill_libs_widget(self, layout: QVBoxLayout): settings = self.driver.settings @@ -341,7 +341,7 @@ class PreviewPanel(QWidget): # remove any potential previous items clear_layout(layout) - label = QLabel("Recent Libraries") + label = QLabel("Recent Libraries") # TODO translate label.setAlignment(Qt.AlignmentFlag.AlignCenter) row_layout = QHBoxLayout() @@ -379,7 +379,7 @@ class PreviewPanel(QWidget): lib = Path(full_val) if not lib.exists() or not (lib / TS_FOLDER_NAME).exists(): button.setDisabled(True) - button.setToolTip("Location is missing") + button.setToolTip("Location is missing") # TODO translate def open_library_button_clicked(path): return lambda: self.driver.open_library(Path(path)) @@ -492,16 +492,16 @@ class PreviewPanel(QWidget): created = dt.fromtimestamp(filepath.stat().st_ctime) modified: dt = dt.fromtimestamp(filepath.stat().st_mtime) self.date_created_label.setText( - f"Date Created: {dt.strftime(created, "%a, %x, %X")}" + f"Date Created: {dt.strftime(created, "%a, %x, %X")}" # TODO translate ) self.date_modified_label.setText( - f"Date Modified: {dt.strftime(modified, "%a, %x, %X")}" + f"Date Modified: {dt.strftime(modified, "%a, %x, %X")}" # TODO translate ) self.date_created_label.setHidden(False) self.date_modified_label.setHidden(False) elif filepath: - self.date_created_label.setText("Date Created: N/A") - self.date_modified_label.setText("Date Modified: N/A") + self.date_created_label.setText("Date Created: N/A") # TODO translate + self.date_modified_label.setText("Date Modified: N/A") # TODO translate self.date_created_label.setHidden(False) self.date_modified_label.setHidden(False) else: @@ -520,7 +520,7 @@ class PreviewPanel(QWidget): if not self.driver.selected: if self.selected or not self.initialized: - self.file_label.setText("No Items Selected") + self.file_label.setText("No Items Selected") # TODO translate self.file_label.set_file_path("") self.file_label.setCursor(Qt.CursorShape.ArrowCursor) @@ -777,7 +777,9 @@ class PreviewPanel(QWidget): self.media_player.hide() self.update_date_label() if self.selected != self.driver.selected: - self.file_label.setText(f"{len(self.driver.selected)} Items Selected") + self.file_label.setText( + f"{len(self.driver.selected)} Items Selected" + ) # TODO translate self.file_label.setCursor(Qt.CursorShape.ArrowCursor) self.file_label.set_file_path("") self.dimensions_label.setText("") @@ -872,10 +874,11 @@ class PreviewPanel(QWidget): else: container = self.containers[index] + # TODO this is in severe need of refactoring due to exessive code duplication if isinstance(field, TagBoxField): container.set_title(field.type.name) container.set_inline(False) - title = f"{field.type.name} (Tag Box)" + title = f"{field.type.name} (Tag Box)" # TODO translate if not is_mixed: inner_container = container.get_inner_widget() @@ -916,8 +919,8 @@ class PreviewPanel(QWidget): ) ) else: - text = "Mixed Data" - title = f"{field.type.name} (Wacky Tag Box)" + text = "Mixed Data" # TODO translate + title = f"{field.type.name} (Wacky Tag Box)" # TODO translate inner_container = TextWidget(title, text) container.set_inner_widget(inner_container) @@ -932,7 +935,7 @@ class PreviewPanel(QWidget): assert isinstance(field.value, (str, type(None))) text = field.value or "" else: - text = "Mixed Data" + text = "Mixed Data" # TODO translate title = f"{field.type.name} ({field.type.type.value})" inner_container = TextWidget(title, text) @@ -941,7 +944,7 @@ class PreviewPanel(QWidget): modal = PanelModal( EditTextLine(field.value), title=title, - window_title=f"Edit {field.type.type.value}", + window_title=f"Edit {field.type.type.value}", # TODO translate save_callback=( lambda content: ( self.update_field(field, content), @@ -973,15 +976,15 @@ class PreviewPanel(QWidget): assert isinstance(field.value, (str, type(None))) text = (field.value or "").replace("\r", "\n") else: - text = "Mixed Data" - title = f"{field.type.name} (Text Box)" + text = "Mixed Data" # TODO translate + title = f"{field.type.name} (Text Box)" # TODO translate inner_container = TextWidget(title, text) container.set_inner_widget(inner_container) if not is_mixed: modal = PanelModal( EditTextBox(field.value), title=title, - window_title=f"Edit {field.type.name}", + window_title=f"Edit {field.type.name}", # TODO translate save_callback=( lambda content: ( self.update_field(field, content), @@ -1008,14 +1011,14 @@ class PreviewPanel(QWidget): container.set_inline(False) # TODO: Localize this and/or add preferences. date = dt.strptime(field.value, "%Y-%m-%d %H:%M:%S") - title = f"{field.type.name} (Date)" + title = f"{field.type.name} (Date)" # TODO translate inner_container = TextWidget(title, date.strftime("%D - %r")) container.set_inner_widget(inner_container) except Exception: container.set_title(field.type.name) # container.set_editable(False) container.set_inline(False) - title = f"{field.type.name} (Date) (Unknown Format)" + title = f"{field.type.name} (Date) (Unknown Format)" # TODO translate inner_container = TextWidget(title, str(field.value)) container.set_inner_widget(inner_container) @@ -1029,15 +1032,15 @@ class PreviewPanel(QWidget): ) ) else: - text = "Mixed Data" - title = f"{field.type.name} (Wacky Date)" + text = "Mixed Data" # TODO translate + title = f"{field.type.name} (Wacky Date)" # TODO translate inner_container = TextWidget(title, text) container.set_inner_widget(inner_container) else: logger.warning("write_container - unknown field", field=field) container.set_title(field.type.name) container.set_inline(False) - title = f"{field.type.name} (Unknown Field Type)" + title = f"{field.type.name} (Unknown Field Type)" # TODO translate inner_container = TextWidget(title, field.type.name) container.set_inner_widget(inner_container) container.set_remove_callback( @@ -1090,10 +1093,12 @@ class PreviewPanel(QWidget): def remove_message_box(self, prompt: str, callback: Callable) -> None: remove_mb = QMessageBox() remove_mb.setText(prompt) - remove_mb.setWindowTitle("Remove Field") + remove_mb.setWindowTitle("Remove Field") # TODO translate remove_mb.setIcon(QMessageBox.Icon.Warning) - cancel_button = remove_mb.addButton("&Cancel", QMessageBox.ButtonRole.DestructiveRole) - remove_mb.addButton("&Remove", QMessageBox.ButtonRole.RejectRole) + cancel_button = remove_mb.addButton( + "&Cancel", QMessageBox.ButtonRole.DestructiveRole + ) # TODO translate + remove_mb.addButton("&Remove", QMessageBox.ButtonRole.RejectRole) # TODO translate # remove_mb.setStandardButtons(QMessageBox.StandardButton.Cancel) remove_mb.setDefaultButton(cancel_button) remove_mb.setEscapeButton(cancel_button) diff --git a/tagstudio/src/qt/widgets/tag.py b/tagstudio/src/qt/widgets/tag.py index 2d4cc7ce..21bb4f6d 100644 --- a/tagstudio/src/qt/widgets/tag.py +++ b/tagstudio/src/qt/widgets/tag.py @@ -126,17 +126,17 @@ class TagWidget(QWidget): self.bg_button.setFlat(True) self.bg_button.setText(tag.name) if has_edit: - edit_action = QAction("Edit", self) + edit_action = QAction("Edit", self) # TODO translate edit_action.triggered.connect(on_edit_callback) edit_action.triggered.connect(self.on_edit.emit) self.bg_button.addAction(edit_action) # if on_click_callback: self.bg_button.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu) - search_for_tag_action = QAction("Search for Tag", self) + search_for_tag_action = QAction("Search for Tag", self) # TODO translate search_for_tag_action.triggered.connect(self.on_click.emit) self.bg_button.addAction(search_for_tag_action) - add_to_search_action = QAction("Add to Search", self) + add_to_search_action = QAction("Add to Search", self) # TODO translate self.bg_button.addAction(add_to_search_action) self.inner_layout = QHBoxLayout() diff --git a/tagstudio/src/qt/widgets/tag_box.py b/tagstudio/src/qt/widgets/tag_box.py index a26ec33a..5a59b25a 100755 --- a/tagstudio/src/qt/widgets/tag_box.py +++ b/tagstudio/src/qt/widgets/tag_box.py @@ -75,7 +75,7 @@ class TagBoxWidget(FieldWidget): ) tsp = TagSearchPanel(self.driver.lib) tsp.tag_chosen.connect(lambda x: self.add_tag_callback(x)) - self.add_modal = PanelModal(tsp, title, "Add Tags") + self.add_modal = PanelModal(tsp, title, "Add Tags") # TODO translate self.add_button.clicked.connect( lambda: ( tsp.update_tags(), @@ -131,7 +131,7 @@ class TagBoxWidget(FieldWidget): self.edit_modal = PanelModal( build_tag_panel, tag.name, # TODO - display name including subtags - "Edit Tag", + "Edit Tag", # TODO translate done_callback=self.driver.preview_panel.update_widgets, has_save=True, ) diff --git a/tagstudio/src/qt/widgets/video_player.py b/tagstudio/src/qt/widgets/video_player.py index 2b4434b1..27d06b2b 100644 --- a/tagstudio/src/qt/widgets/video_player.py +++ b/tagstudio/src/qt/widgets/video_player.py @@ -115,7 +115,7 @@ class VideoPlayer(QGraphicsView): self.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu) self.opener = FileOpenerHelper(filepath=self.filepath) - autoplay_action = QAction("Autoplay", self) + autoplay_action = QAction("Autoplay", self) # TODO translate autoplay_action.setCheckable(True) self.addAction(autoplay_action) autoplay_action.setChecked( @@ -124,7 +124,7 @@ class VideoPlayer(QGraphicsView): autoplay_action.triggered.connect(lambda: self.toggle_autoplay()) self.autoplay = autoplay_action - open_file_action = QAction("Open file", self) + open_file_action = QAction("Open file", self) # TODO translate open_file_action.triggered.connect(self.opener.open_file) open_explorer_action = QAction(PlatformStrings.open_file_str, self)