diff --git a/Makefile b/Makefile index cac9cf248..fb2bf30a4 100644 --- a/Makefile +++ b/Makefile @@ -163,7 +163,7 @@ translation_po_all: TMP_POT_FILE_PATH := $(shell mktemp) PO_FILE_PATH := buzz/locale/${locale}/LC_MESSAGES/buzz.po translation_po: - xgettext --from-code=UTF-8 -o "${TMP_POT_FILE_PATH}" -l python $(shell find buzz/widgets -name '*.py') + xgettext --from-code=UTF-8 -o "${TMP_POT_FILE_PATH}" -l python $(shell find buzz -name '*.py') sed -i.bak 's/CHARSET/UTF-8/' ${TMP_POT_FILE_PATH} && rm ${TMP_POT_FILE_PATH}.bak msgmerge -U ${PO_FILE_PATH} ${TMP_POT_FILE_PATH} diff --git a/buzz/locale/lv_LV/LC_MESSAGES/buzz.po b/buzz/locale/lv_LV/LC_MESSAGES/buzz.po index f3a506533..d6fcc78eb 100644 --- a/buzz/locale/lv_LV/LC_MESSAGES/buzz.po +++ b/buzz/locale/lv_LV/LC_MESSAGES/buzz.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-18 09:04+0300\n" -"PO-Revision-Date: 2024-05-18 10:26+0300\n" +"POT-Creation-Date: 2024-05-18 17:24+0300\n" +"PO-Revision-Date: 2024-05-18 16:28+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: lv_LV\n" @@ -18,6 +18,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.4.3\n" +#: buzz/settings/shortcut.py:17 +msgid "Open Record Window" +msgstr "Atvērt ieraksta logu" + +#: buzz/settings/shortcut.py:18 +msgid "Import File" +msgstr "Importēt failu" + +#: buzz/settings/shortcut.py:19 buzz/widgets/import_url_dialog.py:19 +msgid "Import URL" +msgstr "Importēt URL" + +#: buzz/settings/shortcut.py:20 +msgid "Open Preferences Window" +msgstr "Atvērt iestatījumu logu" + +#: buzz/settings/shortcut.py:22 +msgid "View Transcript Text" +msgstr "Aplūkot atpazīto tekstu" + +#: buzz/settings/shortcut.py:23 +msgid "View Transcript Timestamps" +msgstr "Aplūkot atpazīšanas laikus" + +#: buzz/settings/shortcut.py:25 buzz/widgets/main_window_toolbar.py:60 +#: buzz/widgets/main_window.py:199 +msgid "Clear History" +msgstr "Notīrīt vēsturi" + +#: buzz/settings/shortcut.py:26 buzz/widgets/main_window_toolbar.py:52 +msgid "Cancel Transcription" +msgstr "Atcelt atpazīšanu" + #: buzz/widgets/transcription_tasks_table_widget.py:64 msgid "Completed" msgstr "Pabeigts" @@ -67,14 +100,6 @@ msgstr "Jauna atpazīšanas" msgid "Open Transcript" msgstr "Atvērt transkriptu" -#: buzz/widgets/main_window_toolbar.py:52 -msgid "Cancel Transcription" -msgstr "Atcelt atpazīšanu" - -#: buzz/widgets/main_window_toolbar.py:60 buzz/widgets/main_window.py:199 -msgid "Clear History" -msgstr "Notīrīt vēsturi" - #: buzz/widgets/about_dialog.py:80 msgid "Check for updates" msgstr "Pārbaudīt atjauninājumus" @@ -83,10 +108,6 @@ msgstr "Pārbaudīt atjauninājumus" msgid "You're up to date!" msgstr "Jums ir jaunākā versija!" -#: buzz/widgets/import_url_dialog.py:19 -msgid "Import URL" -msgstr "Importēt URL" - #: buzz/widgets/import_url_dialog.py:22 msgid "https://example.com/audio.mp3" msgstr "https://example.com/audio.mp3" @@ -101,7 +122,7 @@ msgstr "Adrese nav derīga" #: buzz/widgets/import_url_dialog.py:44 msgid "The URL you entered is invalid." -msgstr "Jūsu ievadītā URL adrese nav derīga" +msgstr "Jūsu ievadītā URL adrese nav derīga." #: buzz/widgets/recording_transcriber_widget.py:60 msgid "Live Recording" @@ -153,7 +174,7 @@ msgid "" "cannot be undone." msgstr "" "Vai tiešām vēlaties dzēst izvēlētos transkriptus? Šī ir neatgriezeniska " -"darbība. " +"darbība." #: buzz/widgets/main_window.py:221 msgid "Select audio file" @@ -193,6 +214,10 @@ msgstr "Sākums" msgid "End" msgstr "Beigas" +#: buzz/widgets/transcription_viewer/transcription_viewer_widget.py:89 +msgid "Export" +msgstr "Eksportēt" + #: buzz/widgets/record_button.py:21 msgid "Stop" msgstr "Apturēt" @@ -217,6 +242,14 @@ msgstr "Sākotnējais vaicājums:" msgid "Word-level timings" msgstr "Dalīt pa vārdiem" +#: buzz/widgets/transcriber/file_transcription_form_widget.py:66 +msgid "Export:" +msgstr "Eksportēt:" + +#: buzz/widgets/transcriber/advanced_settings_button.py:9 +msgid "Advanced..." +msgstr "Papildu iestatījumi..." + #: buzz/widgets/transcriber/initial_prompt_text_edit.py:10 msgid "Enter prompt..." msgstr "Ievadiet vaicājumu..." @@ -234,12 +267,67 @@ msgid "Language:" msgstr "Valoda:" #: buzz/widgets/transcriber/languages_combo_box.py:25 +#: buzz/transcriber/transcriber.py:149 msgid "Detect Language" msgstr "Noteikt valodu" #: buzz/widgets/transcriber/file_transcriber_widget.py:79 msgid "Run" -msgstr "Palaist" +msgstr "Apstrādāt" + +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:42 +msgid "Enable folder watch" +msgstr "Ieslēgt mapes vērošanu" + +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:47 +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:50 +msgid "Browse" +msgstr "Izvēlēties" + +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:94 +msgid "Input folder" +msgstr "Vērojamā mape" + +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:95 +msgid "Output folder" +msgstr "Rezultātu mape" + +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:105 +msgid "Select Input Folder" +msgstr "Izvēlieties vērojamo mapi" + +#: buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py:114 +msgid "Select Output Folder" +msgstr "Izvēlieties rezultātu mapi" + +#: buzz/widgets/preferences_dialog/general_preferences_widget.py:31 +msgid "Test" +msgstr "Pārbaudīt" + +#: buzz/widgets/preferences_dialog/general_preferences_widget.py:37 +msgid "OpenAI API key" +msgstr "OpenAI API atslēga" + +#: buzz/widgets/preferences_dialog/general_preferences_widget.py:49 +msgid "Default export file name" +msgstr "Eksporta faila nosaukums" + +#: buzz/widgets/preferences_dialog/general_preferences_widget.py:74 +#: buzz/widgets/preferences_dialog/general_preferences_widget.py:80 +msgid "OpenAI API Key Test" +msgstr "OpenAI API atslēgas pārbaude" + +#: buzz/widgets/preferences_dialog/general_preferences_widget.py:75 +msgid "" +"Your API key is valid. Buzz will use this key to perform Whisper API " +"transcriptions." +msgstr "" +"Jūsu API atslēga ir derīga. Buzz izmantos to runas atpazīšanai ar Whisper " +"API." + +#: buzz/widgets/preferences_dialog/models_preferences_widget.py:61 +msgid "Group" +msgstr "Veids" #: buzz/widgets/preferences_dialog/models_preferences_widget.py:70 msgid "Download" @@ -247,7 +335,7 @@ msgstr "Lejupielādēt" #: buzz/widgets/preferences_dialog/models_preferences_widget.py:75 msgid "Show file location" -msgstr "Rādīt faila atrašanos" +msgstr "Pādīt faila atrašanās vietu" #: buzz/widgets/preferences_dialog/models_preferences_widget.py:83 msgid "Delete" @@ -269,13 +357,17 @@ msgstr "Dzēst modeli" msgid "Are you sure you want to delete the selected model?" msgstr "Vai tiešām dzēst izvēlēto modeli?" +#: buzz/widgets/preferences_dialog/shortcuts_editor_preferences_widget.py:29 +msgid "Reset to Defaults" +msgstr "Atjaunot noklusētos" + #: buzz/widgets/preferences_dialog/preferences_dialog.py:50 msgid "General" msgstr "Vizpārīgi" #: buzz/widgets/preferences_dialog/preferences_dialog.py:53 msgid "Models" -msgstr "Modelis" +msgstr "Modeļi" #: buzz/widgets/preferences_dialog/preferences_dialog.py:57 msgid "Shortcuts" diff --git a/buzz/settings/shortcut.py b/buzz/settings/shortcut.py index 32cc238b6..023448bd4 100644 --- a/buzz/settings/shortcut.py +++ b/buzz/settings/shortcut.py @@ -1,5 +1,6 @@ import enum import typing +from buzz.locale import _ class Shortcut(str, enum.Enum): @@ -13,16 +14,16 @@ def __new__(cls, sequence: str, description: str): obj.description = description return obj - OPEN_RECORD_WINDOW = ("Ctrl+R", "Open Record Window") - OPEN_IMPORT_WINDOW = ("Ctrl+O", "Import File") - OPEN_IMPORT_URL_WINDOW = ("Ctrl+U", "Import URL") - OPEN_PREFERENCES_WINDOW = ("Ctrl+,", "Open Preferences Window") + OPEN_RECORD_WINDOW = ("Ctrl+R", _("Open Record Window")) + OPEN_IMPORT_WINDOW = ("Ctrl+O", _("Import File")) + OPEN_IMPORT_URL_WINDOW = ("Ctrl+U", _("Import URL")) + OPEN_PREFERENCES_WINDOW = ("Ctrl+,", _("Open Preferences Window")) - VIEW_TRANSCRIPT_TEXT = ("Ctrl+E", "View Transcript Text") - VIEW_TRANSCRIPT_TIMESTAMPS = ("Ctrl+T", "View Transcript Timestamps") + VIEW_TRANSCRIPT_TEXT = ("Ctrl+E", _("View Transcript Text")) + VIEW_TRANSCRIPT_TIMESTAMPS = ("Ctrl+T", _("View Transcript Timestamps")) - CLEAR_HISTORY = ("Ctrl+S", "Clear History") - STOP_TRANSCRIPTION = ("Ctrl+X", "Cancel Transcription") + CLEAR_HISTORY = ("Ctrl+S", _("Clear History")) + STOP_TRANSCRIPTION = ("Ctrl+X", _("Cancel Transcription")) @staticmethod def get_default_shortcuts() -> typing.Dict[str, str]: diff --git a/buzz/widgets/model_download_progress_dialog.py b/buzz/widgets/model_download_progress_dialog.py index 727ed4d3a..8e392013c 100644 --- a/buzz/widgets/model_download_progress_dialog.py +++ b/buzz/widgets/model_download_progress_dialog.py @@ -37,7 +37,7 @@ def update_label_text(self, fraction_completed: float): if fraction_completed > 0: time_spent = (datetime.now() - self.start_time).total_seconds() time_left = (time_spent / fraction_completed) - time_spent - label_text += f", {humanize.naturaldelta(time_left)} remaining" + label_text += f", {humanize.naturaldelta(time_left)} {_('remaining')}" label_text += ")" self.setLabelText(label_text) diff --git a/buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py b/buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py index e1936198a..abc8c371c 100644 --- a/buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py +++ b/buzz/widgets/preferences_dialog/folder_watch_preferences_widget.py @@ -11,6 +11,7 @@ QVBoxLayout, ) +from buzz.locale import _ from buzz.store.keyring_store import Key, get_password from buzz.transcriber.transcriber import ( TranscriptionOptions, @@ -38,15 +39,15 @@ def __init__( self.config = config - checkbox = QCheckBox("Enable folder watch") + checkbox = QCheckBox(_("Enable folder watch")) checkbox.setChecked(config.enabled) checkbox.setObjectName("EnableFolderWatchCheckbox") checkbox.stateChanged.connect(self.on_enable_changed) - input_folder_browse_button = QPushButton("Browse") + input_folder_browse_button = QPushButton(_("Browse")) input_folder_browse_button.clicked.connect(self.on_click_browse_input_folder) - output_folder_browse_button = QPushButton("Browse") + output_folder_browse_button = QPushButton(_("Browse")) output_folder_browse_button.clicked.connect(self.on_click_browse_output_folder) input_folder_row = QHBoxLayout() @@ -90,8 +91,8 @@ def __init__( folders_form_layout = QFormLayout() folders_form_layout.addRow("", checkbox) - folders_form_layout.addRow("Input folder", input_folder_row) - folders_form_layout.addRow("Output folder", output_folder_row) + folders_form_layout.addRow(_("Input folder"), input_folder_row) + folders_form_layout.addRow(_("Output folder"), output_folder_row) folders_form_layout.addWidget(transcription_form_widget) layout.addLayout(folders_form_layout) @@ -101,7 +102,7 @@ def __init__( self.setLayout(layout) def on_click_browse_input_folder(self): - folder = QFileDialog.getExistingDirectory(self, "Select Input Folder") + folder = QFileDialog.getExistingDirectory(self, _("Select Input Folder")) self.input_folder_line_edit.setText(folder) self.on_input_folder_changed(folder) @@ -110,7 +111,7 @@ def on_input_folder_changed(self, folder): self.config_changed.emit(self.config) def on_click_browse_output_folder(self): - folder = QFileDialog.getExistingDirectory(self, "Select Output Folder") + folder = QFileDialog.getExistingDirectory(self, _("Select Output Folder")) self.output_folder_line_edit.setText(folder) self.on_output_folder_changed(folder) diff --git a/buzz/widgets/preferences_dialog/general_preferences_widget.py b/buzz/widgets/preferences_dialog/general_preferences_widget.py index 5ba566920..fb5fd58b2 100644 --- a/buzz/widgets/preferences_dialog/general_preferences_widget.py +++ b/buzz/widgets/preferences_dialog/general_preferences_widget.py @@ -8,7 +8,7 @@ from buzz.store.keyring_store import get_password, Key from buzz.widgets.line_edit import LineEdit from buzz.widgets.openai_api_key_line_edit import OpenAIAPIKeyLineEdit - +from buzz.locale import _ class GeneralPreferencesWidget(QWidget): openai_api_key_changed = pyqtSignal(str) @@ -28,13 +28,13 @@ def __init__( self.on_openai_api_key_changed ) - self.test_openai_api_key_button = QPushButton("Test") + self.test_openai_api_key_button = QPushButton(_("Test")) self.test_openai_api_key_button.clicked.connect( self.on_click_test_openai_api_key_button ) self.update_test_openai_api_key_button() - layout.addRow("OpenAI API key", self.openai_api_key_line_edit) + layout.addRow(_("OpenAI API key"), self.openai_api_key_line_edit) layout.addRow("", self.test_openai_api_key_button) self.settings = Settings() @@ -46,7 +46,7 @@ def __init__( self.on_default_export_file_name_changed ) default_export_file_name_line_edit.setMinimumWidth(200) - layout.addRow("Default export file name", default_export_file_name_line_edit) + layout.addRow(_("Default export file name"), default_export_file_name_line_edit) self.setLayout(layout) @@ -71,13 +71,13 @@ def on_test_openai_api_key_success(self): self.test_openai_api_key_button.setEnabled(True) QMessageBox.information( self, - "OpenAI API Key Test", - "Your API key is valid. Buzz will use this key to perform Whisper API transcriptions.", + _("OpenAI API Key Test"), + _("Your API key is valid. Buzz will use this key to perform Whisper API transcriptions."), ) def on_test_openai_api_key_failure(self, error: str): self.test_openai_api_key_button.setEnabled(True) - QMessageBox.warning(self, "OpenAI API Key Test", error) + QMessageBox.warning(self, _("OpenAI API Key Test"), error) def on_openai_api_key_changed(self, key: str): self.openai_api_key = key diff --git a/buzz/widgets/preferences_dialog/models_preferences_widget.py b/buzz/widgets/preferences_dialog/models_preferences_widget.py index 931f0fb78..57e81ac4f 100644 --- a/buzz/widgets/preferences_dialog/models_preferences_widget.py +++ b/buzz/widgets/preferences_dialog/models_preferences_widget.py @@ -58,7 +58,7 @@ def __init__( parent=self, ) model_type_combo_box.changed.connect(self.on_model_type_changed) - layout.addRow("Group", model_type_combo_box) + layout.addRow(_("Group"), model_type_combo_box) self.model_list_widget = QTreeWidget() self.model_list_widget.setColumnCount(1) @@ -188,7 +188,7 @@ def on_download_error(self, error: str): self.progress_dialog = None self.download_button.setEnabled(True) self.reset() - QMessageBox.warning(self, _("Error"), f"Download failed: {error}") + QMessageBox.warning(self, _("Error"), f"{_('Download failed')}: {error}") def on_download_progress(self, progress: tuple): self.progress_dialog.set_value(float(progress[0]) / progress[1]) diff --git a/buzz/widgets/preferences_dialog/shortcuts_editor_preferences_widget.py b/buzz/widgets/preferences_dialog/shortcuts_editor_preferences_widget.py index d7c9e881b..e057d4296 100644 --- a/buzz/widgets/preferences_dialog/shortcuts_editor_preferences_widget.py +++ b/buzz/widgets/preferences_dialog/shortcuts_editor_preferences_widget.py @@ -4,6 +4,7 @@ from PyQt6.QtGui import QKeySequence from PyQt6.QtWidgets import QWidget, QFormLayout, QPushButton +from buzz.locale import _ from buzz.settings.shortcut import Shortcut from buzz.settings.shortcuts import Shortcuts from buzz.widgets.sequence_edit import SequenceEdit @@ -25,7 +26,7 @@ def __init__(self, shortcuts: Shortcuts, parent: Optional[QWidget] = None): ) self.layout.addRow(shortcut.description, sequence_edit) - reset_to_defaults_button = QPushButton("Reset to Defaults", self) + reset_to_defaults_button = QPushButton(_("Reset to Defaults"), self) reset_to_defaults_button.setDefault(False) reset_to_defaults_button.setAutoDefault(False) reset_to_defaults_button.clicked.connect(self.reset_to_defaults) diff --git a/buzz/widgets/transcriber/advanced_settings_button.py b/buzz/widgets/transcriber/advanced_settings_button.py index 4bc92657d..4b74ebb67 100644 --- a/buzz/widgets/transcriber/advanced_settings_button.py +++ b/buzz/widgets/transcriber/advanced_settings_button.py @@ -2,7 +2,8 @@ from PyQt6.QtWidgets import QPushButton, QWidget +from buzz.locale import _ class AdvancedSettingsButton(QPushButton): def __init__(self, parent: Optional[QWidget]) -> None: - super().__init__("Advanced...", parent) + super().__init__(_("Advanced..."), parent) diff --git a/buzz/widgets/transcriber/file_transcription_form_widget.py b/buzz/widgets/transcriber/file_transcription_form_widget.py index 3eaf9cae1..d21590dc0 100644 --- a/buzz/widgets/transcriber/file_transcription_form_widget.py +++ b/buzz/widgets/transcriber/file_transcription_form_widget.py @@ -63,7 +63,7 @@ def __init__( ) export_format_layout.addWidget(export_format_checkbox) - file_transcription_layout.addRow("Export:", export_format_layout) + file_transcription_layout.addRow(_("Export:"), export_format_layout) layout.addWidget(transcription_options_group_box) layout.addLayout(file_transcription_layout) diff --git a/buzz/widgets/transcription_viewer/transcription_viewer_widget.py b/buzz/widgets/transcription_viewer/transcription_viewer_widget.py index 861168f21..b1f84895e 100644 --- a/buzz/widgets/transcription_viewer/transcription_viewer_widget.py +++ b/buzz/widgets/transcription_viewer/transcription_viewer_widget.py @@ -13,6 +13,7 @@ QLabel, ) +from buzz.locale import _ from buzz.db.entity.transcription import Transcription from buzz.db.service.transcription_service import TranscriptionService from buzz.paths import file_path_as_title @@ -85,7 +86,7 @@ def __init__( toolbar.addWidget(view_mode_tool_button) export_tool_button = QToolButton() - export_tool_button.setText("Export") + export_tool_button.setText(_("Export")) export_tool_button.setIcon(FileDownloadIcon(self)) export_tool_button.setToolButtonStyle( Qt.ToolButtonStyle.ToolButtonTextBesideIcon