diff --git a/about.py b/about.py index 58b3fb7..8917855 100644 --- a/about.py +++ b/about.py @@ -5,7 +5,7 @@ from calibre.utils.localization import get_lang from . import EbookTranslator -from .components import layout_info +from .components import Footer try: @@ -62,7 +62,7 @@ def __init__(self, plugin, parent, icon): layout.addWidget(brand, 1) layout.addWidget(description, 2) - layout.addWidget(layout_info()) + layout.addWidget(Footer()) def get_readme(self): default = 'README.md' diff --git a/advanced.py b/advanced.py index fce0904..017343b 100644 --- a/advanced.py +++ b/advanced.py @@ -14,7 +14,7 @@ from . import EbookTranslator from .components import ( - EngineList, layout_info, SourceLang, TargetLang, InputFormat, OutputFormat, + EngineList, Footer, SourceLang, TargetLang, InputFormat, OutputFormat, AlertMessage, AdvancedTranslationTable, StatusColor, TranslationStatus) @@ -315,6 +315,7 @@ def __init__(self, parent, icon, worker, ebook): self.ebook = ebook self.config = get_config() self.alert = AlertMessage(self) + self.footer = Footer() # self.error = JobError(self) self.current_engine = get_engine_class() self.cache = None @@ -349,7 +350,7 @@ def __init__(self, parent, icon, worker, ebook): self.stack = QStackedWidget() self.stack.addWidget(self.waiting) layout.addWidget(self.stack) - layout.addWidget(layout_info()) + layout.addWidget(self.footer) def working_status(): self.logging_text.clear() @@ -562,6 +563,7 @@ def write_progress(): counter_layout.addWidget(paragraph_count) counter_layout.addWidget(non_aligned_paragraph_count) counter_layout.addStretch(1) + self.footer.layout().insertWidget(0, counter) def get_paragraph_count(select_all=True): item_count = char_count = 0 @@ -597,7 +599,6 @@ def show_none_aligned_count(): layout.addWidget(filter_widget) layout.addWidget(self.table, 1) layout.addWidget(progress_bar) - layout.addWidget(counter) layout.addWidget(self.layout_table_control()) def working_start(): @@ -893,6 +894,7 @@ def auto_open_close_splitter(): save_status = QLabel() save_button = QPushButton(_('Save')) + save_button.setDisabled(True) status_indicator = TranslationStatus() @@ -915,7 +917,8 @@ def update_translation_status(row): else: status_indicator.set_color(StatusColor('gray')) elif not paragraph.aligned and self.merge_enabled: - status_indicator.set_color(StatusColor('yellow')) + status_indicator.set_color( + StatusColor('yellow'), ) else: status_indicator.set_color(StatusColor('green')) self.table.row.connect(update_translation_status) @@ -952,11 +955,9 @@ def modify_translation(): if self.trans_worker.on_working and \ self.table.selected_count() > 1: return - save_button.setDisabled(False) - # paragraph = self.table.current_paragraph() - # translation = translation_text.toPlainText() - # control.setVisible( - # bool(translation) and translation != paragraph.translation) + paragraph = self.table.current_paragraph() + translation = translation_text.toPlainText() + save_button.setDisabled(translation == paragraph.translation) translation_text.textChanged.connect(modify_translation) def save_translation(): @@ -967,11 +968,9 @@ def save_translation(): paragraph.target_lang = self.ebook.target_lang self.table.row.emit(paragraph.row) self.cache.update_paragraph(paragraph) - # self.editor_worker.start[str, object].emit( - # _('Your changes have been saved.'), - # lambda: control.setVisible(False)) - self.editor_worker.start[str].emit( - _('Your changes have been saved.')) + self.editor_worker.start[str, object].emit( + _('Your changes have been saved.'), + lambda: save_button.setDisabled(True)) translation_text.setFocus(Qt.OtherFocusReason) self.editor_worker.show.connect(save_status.setText) save_button.clicked.connect(save_translation) diff --git a/batch.py b/batch.py index 0722b0c..9847277 100644 --- a/batch.py +++ b/batch.py @@ -7,18 +7,18 @@ from .lib.encodings import encoding_list from .engines.custom import CustomTranslate from .components import ( - layout_info, AlertMessage, SourceLang, TargetLang, InputFormat, + Footer, AlertMessage, SourceLang, TargetLang, InputFormat, OutputFormat) try: from qt.core import ( QDialog, QWidget, QPushButton, QHeaderView, QVBoxLayout, QTableWidget, - QTableWidgetItem, Qt, QComboBox, QLabel) + QTableWidgetItem, Qt, QComboBox, QLabel, QSizePolicy, QHBoxLayout) except ImportError: from PyQt5.Qt import ( QDialog, QWidget, QPushButton, QHeaderView, QVBoxLayout, QTableWidget, - QTableWidgetItem, Qt, QComboBox, QLabel) + QTableWidgetItem, Qt, QComboBox, QLabel, QSizePolicy, QHBoxLayout) load_translations() @@ -42,7 +42,17 @@ def __init__(self, parent, worker, ebooks): def main_layout(self): layout = QVBoxLayout(self) layout.addWidget(self.layout_translate()) - layout.addWidget(layout_info()) + layout.addWidget(Footer()) + + def _cell_widget(self, _widget): + widget = QWidget() + layout = QHBoxLayout(widget) + layout.setContentsMargins(5, 5, 5, 5) + # _widget.setFixedSize(_widget.sizeHint()) + _widget.setFixedHeight(_widget.sizeHint().height()) + layout.addWidget(_widget, 1) + # layout.setAlignment(_widget, Qt.AlignCenter) + return widget def layout_translate(self): widget = QWidget() @@ -50,7 +60,10 @@ def layout_translate(self): layout.setContentsMargins(0, 0, 0, 0) table = QTableWidget() - table.setStyleSheet('QComboBox{border:0;}') + table.setAlternatingRowColors(True) + table.setFocusPolicy(Qt.NoFocus) + table.setSelectionMode(QTableWidget.NoSelection) + # table.SelectionBehavior(QTableWidget.SelectRows) table.setRowCount(len(self.ebooks)) table.setColumnCount(5) table.setHorizontalHeaderLabels([ @@ -61,13 +74,12 @@ def layout_translate(self): stretch = getattr(QHeaderView.ResizeMode, 'Stretch', None) or \ QHeaderView.Stretch header.setSectionResizeMode(0, stretch) + # table.verticalHeader().setMinimumSectionSize(100) translation_engine = get_engine_class() - for row, ebook in enumerate(self.ebooks): ebook_title = QTableWidgetItem(ebook.title) ebook_title.setFlags(Qt.ItemIsEnabled) - ebook_title.setSizeHint(table.sizeHint()) table.setItem(row, 0, ebook_title) if ebook.input_format in extra_formats.keys(): @@ -78,13 +90,15 @@ def layout_translate(self): .set_encoding(encoding)) else: input_encoding = QLabel(_('Default')) - table.setCellWidget(row, 1, input_encoding) + input_encoding.setDisabled(True) + input_encoding.setAlignment(Qt.AlignCenter) + table.setCellWidget(row, 1, self._cell_widget(input_encoding)) input_fmt = InputFormat(ebook.files.keys()) - table.setCellWidget(row, 2, input_fmt) + table.setCellWidget(row, 2, self._cell_widget(input_fmt)) output_format = OutputFormat() - table.setCellWidget(row, 3, output_format) + table.setCellWidget(row, 3, self._cell_widget(output_format)) exist_format = output_format.findText(ebook.input_format) if ebook.is_extra_format() and exist_format: @@ -106,7 +120,7 @@ def change_output_format(format, row=row): output_format.currentTextChanged.connect(change_output_format) source_lang = SourceLang(book_lang=ebook.source_lang) - table.setCellWidget(row, 4, source_lang) + table.setCellWidget(row, 4, self._cell_widget(source_lang)) self.source_langs.append(source_lang) def change_source_lang(lang, row=row): @@ -120,7 +134,7 @@ def change_source_lang(lang, row=row): not issubclass(translation_engine, CustomTranslate)) target_lang = TargetLang() - table.setCellWidget(row, 5, target_lang) + table.setCellWidget(row, 5, self._cell_widget(target_lang)) self.target_langs.append(target_lang) def change_target_lang(lang, row=row): @@ -135,6 +149,8 @@ def change_target_lang(lang, row=row): translation_engine.lang_codes.get('target'), translation_engine.config.get('target_lang')) + table.resizeRowsToContents() + # table.resizeColumnsToContents() layout.addWidget(table) start_button = QPushButton(_('Translate')) diff --git a/cache.py b/cache.py index f03a987..5902171 100644 --- a/cache.py +++ b/cache.py @@ -5,7 +5,7 @@ from .lib.utils import open_path from .lib.cache import default_cache_path, TranslationCache from .lib.config import get_config -from .components import layout_info, AlertMessage +from .components import Footer, AlertMessage try: from qt.core import ( @@ -30,13 +30,17 @@ def __init__(self, plugin, parent): self.gui = parent self.config = get_config() self.alert = AlertMessage(self) + self.footer = Footer() self.default_path = default_cache_path() + self.cache_size = QLabel() + self.footer.layout().insertWidget(0, self.cache_size) + self.layout = QVBoxLayout(self) self.layout.addWidget(self.control_widget()) self.layout.addWidget(self.table_widget()) self.layout.addWidget(self.enable_widget()) - self.layout.addWidget(layout_info()) + self.layout.addWidget(self.footer) self.cache_list.selected_rows.connect( lambda rows: self.delete_button.setDisabled(len(rows) < 1)) @@ -86,15 +90,14 @@ def enable_widget(self): widget = QWidget() layout = QHBoxLayout(widget) layout.setContentsMargins(0, 0, 0, 0) - self.cache_size = QLabel() + self.clear_button = QPushButton(_('Clear All')) self.clear_button.setDisabled(True) self.delete_button = QPushButton(_('Delete')) self.delete_button.setDisabled(True) - layout.addWidget(self.cache_size) - layout.addStretch(1) layout.addWidget(self.clear_button) + layout.addStretch(1) layout.addWidget(self.delete_button) return widget diff --git a/components/__init__.py b/components/__init__.py index 4b0d42c..b893daa 100644 --- a/components/__init__.py +++ b/components/__init__.py @@ -1,5 +1,5 @@ from .engine import EngineList, EngineTester, ManageCustomEngine -from .info import layout_info +from .footer import Footer from .lang import SourceLang, TargetLang from .format import InputFormat, OutputFormat from .alert import AlertMessage diff --git a/components/footer.py b/components/footer.py new file mode 100644 index 0000000..3d4e636 --- /dev/null +++ b/components/footer.py @@ -0,0 +1,40 @@ +from calibre.utils.localization import get_lang +from calibre_plugins.ebook_translator import EbookTranslator + + +try: + from qt.core import QWidget, QHBoxLayout, QLabel +except ImportError: + from PyQt5.Qt import QWidget, QHBoxLayout, QLabel + +load_translations() + + +class Footer(QWidget): + + def __init__(self, parent=None): + QWidget.__init__(self, parent) + self.status = QLabel() + + app_author = EbookTranslator.author + github = 'https://github.com/bookfere/Ebook-Translator-Calibre-Plugin' + if 'zh' in get_lang(): + feedback = 'https://{}/post/1057.html'.format(app_author) + donate = 'https://{}/donate'.format(app_author) + else: + feedback = '{}/issues'.format(github) + donate = 'https://www.paypal.com/paypalme/bookfere' + link = QLabel( + ' by ' + '{0}GitHub{4}' + ' | {5}'.format( + app_author, github, feedback, donate, _('Feedback'), + _('Donate'))) + link.setStyleSheet('color:grey') + link.setOpenExternalLinks(True) + + layout = QHBoxLayout(self) + layout.setContentsMargins(0, 0, 0, 0) + layout.addWidget(self.status) + layout.addStretch(1) + layout.addWidget(link) diff --git a/components/info.py b/components/info.py deleted file mode 100644 index 05cdaae..0000000 --- a/components/info.py +++ /dev/null @@ -1,39 +0,0 @@ -from calibre.utils.localization import get_lang -from calibre_plugins.ebook_translator import EbookTranslator - - -try: - from qt.core import QWidget, QHBoxLayout, QLabel -except ImportError: - from PyQt5.Qt import QWidget, QHBoxLayout, QLabel - -load_translations() - - -def layout_info(): - widget = QWidget() - widget.setStyleSheet('color:grey') - layout = QHBoxLayout(widget) - layout.setContentsMargins(0, 0, 0, 0) - app_author = EbookTranslator.author - site = QLabel( - ' by {0}' - .format(app_author)) - site.setOpenExternalLinks(True) - layout.addWidget(site) - layout.addStretch(1) - github = 'https://github.com/bookfere/Ebook-Translator-Calibre-Plugin' - if 'zh' in get_lang(): - feedback = 'https://{}/post/1057.html'.format(app_author) - donate = 'https://{}/donate'.format(app_author) - else: - feedback = '{}/issues'.format(github) - donate = 'https://www.paypal.com/paypalme/bookfere' - link = QLabel(( - 'GitHub{3}' - ' | {4}') - .format(github, feedback, donate, _('Feedback'), _('Donate'))) - link.setOpenExternalLinks(True) - layout.addWidget(link) - - return widget diff --git a/components/lang.py b/components/lang.py index e2119f3..909ee97 100644 --- a/components/lang.py +++ b/components/lang.py @@ -3,9 +3,9 @@ try: - from qt.core import pyqtSignal, pyqtSlot, QComboBox + from qt.core import pyqtSignal, pyqtSlot, QComboBox, QVBoxLayout except ImportError: - from PyQt5.Qt import pyqtSignal, pyqtSlot, QComboBox + from PyQt5.Qt import pyqtSignal, pyqtSlot, QComboBox, QVBoxLayout load_translations() diff --git a/components/table.py b/components/table.py index ec29626..b2c1759 100644 --- a/components/table.py +++ b/components/table.py @@ -62,8 +62,10 @@ def layout(self): original.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) original.setData(Qt.UserRole, paragraph) engine_name = QTableWidgetItem(paragraph.engine_name) + engine_name.setToolTip(paragraph.engine_name) engine_name.setTextAlignment(Qt.AlignCenter) traget_lang = QTableWidgetItem(paragraph.target_lang) + traget_lang.setToolTip(paragraph.target_lang) traget_lang.setTextAlignment(Qt.AlignCenter) status = QTableWidgetItem() status.setTextAlignment(Qt.AlignCenter) @@ -152,7 +154,7 @@ def set_row_background_color( for column in range(self.columnCount()): item = self.item(row, column) item.setBackground(background) - item.setToolTip(tip) + item.setToolTip(tip) def contextMenuEvent(self, event): if self.parent.trans_worker.on_working: diff --git a/setting.py b/setting.py index 6564e0d..7cd3394 100644 --- a/setting.py +++ b/setting.py @@ -11,7 +11,7 @@ ClaudeTranslate) from .engines.custom import CustomTranslate from .components import ( - layout_info, AlertMessage, TargetLang, SourceLang, EngineList, + Footer, AlertMessage, TargetLang, SourceLang, EngineList, EngineTester, ManageCustomEngine, InputFormat, OutputFormat) try: @@ -78,7 +78,7 @@ def save_setting(index): self.save_config.connect(save_setting) layout.addWidget(self.tabs) - layout.addWidget(layout_info()) + layout.addWidget(Footer()) def layout_scroll_area(func): def scroll_widget(self): @@ -1010,6 +1010,24 @@ def choose_glossary_file(): _('Stop further extraction once elements match these rules.')))) layout.addWidget(priority_group) + # Ignore element + element_group = QGroupBox(_('Ignore Element')) + element_layout = QVBoxLayout(element_group) + self.ignore_rules = QPlainTextEdit() + self.ignore_rules.setPlaceholderText( + '%s %s' % (_('e.g.,'), 'table, table#report, table.list')) + self.ignore_rules.setMinimumHeight(100) + self.ignore_rules.insertPlainText( + '\n'.join(self.config.get( + 'ignore_rules', self.config.get('element_rules')))) + element_layout.addWidget(QLabel( + _('CSS selectors to exclude elements. One rule per line:'))) + element_layout.addWidget(self.ignore_rules) + element_layout.addWidget(QLabel('%s%s' % ( + _('Tip: '), + _('Do not translation elements that matches these rules.')))) + layout.addWidget(element_group) + # Filter Content filter_group = QGroupBox(_('Ignore Paragraph')) filter_layout = QVBoxLayout(filter_group) @@ -1049,8 +1067,8 @@ def choose_glossary_file(): filter_layout.addWidget(tip) filter_layout.addWidget(self.filter_rules) filter_layout.addWidget(QLabel('%s%s' % ( - _('Tip: '), - _('Do not translate elements that contain these keywords.')))) + _('Tip: '), _('Do not translate extracted elements that contain ' + 'these rules.')))) layout.addWidget(filter_group) scope_map = dict(enumerate(['text', 'html'])) @@ -1094,24 +1112,6 @@ def choose_filter_mode(btn_id): mode_btn_group.buttonClicked[int] mode_btn_click.connect(choose_filter_mode) - # Ignore element - element_group = QGroupBox(_('Ignore Element')) - element_layout = QVBoxLayout(element_group) - self.ignore_rules = QPlainTextEdit() - self.ignore_rules.setPlaceholderText( - '%s %s' % (_('e.g.,'), 'table, table#report, table.list')) - self.ignore_rules.setMinimumHeight(100) - self.ignore_rules.insertPlainText( - '\n'.join(self.config.get( - 'ignore_rules', self.config.get('element_rules')))) - element_layout.addWidget(QLabel( - _('CSS selectors to exclude elements. One rule per line:'))) - element_layout.addWidget(self.ignore_rules) - element_layout.addWidget(QLabel('%s%s' % ( - _('Tip: '), - _('Do not translation elements that matches these rules.')))) - layout.addWidget(element_group) - # Reserve element reserve_group = QGroupBox(_('Reserve Element')) reserve_layout = QVBoxLayout(reserve_group) diff --git a/translations/es.po b/translations/es.po index 29054a2..b62edb9 100644 --- a/translations/es.po +++ b/translations/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: 2023-04-17 14:17+0800\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -287,6 +287,12 @@ msgstr "El nombre del motor ya está en uso." msgid "The setting has been saved." msgstr "La configuración ha sido guardada." +msgid "Feedback" +msgstr "Comentario" + +msgid "Donate" +msgstr "Donar" + msgid "Ebook Specific" msgstr "" @@ -296,12 +302,6 @@ msgstr "" msgid "Not selected" msgstr "" -msgid "Donate" -msgstr "Donar" - -msgid "Feedback" -msgstr "Comentario" - msgid "Auto detect" msgstr "Detección automática" @@ -701,6 +701,15 @@ msgstr "" msgid "Stop further extraction once elements match these rules." msgstr "" +msgid "Ignore Element" +msgstr "" + +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "" + +msgid "Do not translation elements that matches these rules." +msgstr "" + msgid "Ignore Paragraph" msgstr "Ignorar párrafo" @@ -725,7 +734,7 @@ msgstr "Normal (sensible a mayúsculas y minúsculas)" msgid "Regular Expression" msgstr "Expresión regular" -msgid "Do not translate elements that contain these keywords." +msgid "Do not translate extracted elements that contain these rules." msgstr "" msgid "Exclude paragraph by keyword. One keyword per line:" @@ -739,15 +748,6 @@ msgstr "" msgid "Exclude paragraph by regular expression pattern. One pattern per line:" msgstr "Excluir párrafo por patrón de expresión regular. Un patrón por línea:" -msgid "Ignore Element" -msgstr "" - -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "" - -msgid "Do not translation elements that matches these rules." -msgstr "" - msgid "Reserve Element" msgstr "" diff --git a/translations/fr.po b/translations/fr.po index 2fedb12..1f35778 100644 --- a/translations/fr.po +++ b/translations/fr.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: 2023-10-01 15:35-0400\n" "Last-Translator: PoP\n" @@ -291,6 +291,12 @@ msgstr "Le nom du moteur est déjà utilisé." msgid "The setting has been saved." msgstr "Le réglage a été enregistré." +msgid "Feedback" +msgstr "Commentaires" + +msgid "Donate" +msgstr "Donner" + msgid "Ebook Specific" msgstr "Spécifique à un ebook" @@ -300,12 +306,6 @@ msgstr "" msgid "Not selected" msgstr "" -msgid "Donate" -msgstr "Donner" - -msgid "Feedback" -msgstr "Commentaires" - msgid "Auto detect" msgstr "Détection automatique" @@ -711,6 +711,15 @@ msgstr "" msgid "Stop further extraction once elements match these rules." msgstr "" +msgid "Ignore Element" +msgstr "Ignorer l'élément" + +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "Sélecteurs CSS pour exclure des éléments. Une règle par ligne:" + +msgid "Do not translation elements that matches these rules." +msgstr "" + msgid "Ignore Paragraph" msgstr "Ignorer paragraphe" @@ -735,7 +744,7 @@ msgstr "Normal (sensible à la casse)" msgid "Regular Expression" msgstr "Expression régulière" -msgid "Do not translate elements that contain these keywords." +msgid "Do not translate extracted elements that contain these rules." msgstr "" msgid "Exclude paragraph by keyword. One keyword per line:" @@ -750,15 +759,6 @@ msgstr "" "Exclure le paragraphe par patron d'expression régulière. Un mot-clé par " "ligne:" -msgid "Ignore Element" -msgstr "Ignorer l'élément" - -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "Sélecteurs CSS pour exclure des éléments. Une règle par ligne:" - -msgid "Do not translation elements that matches these rules." -msgstr "" - msgid "Reserve Element" msgstr "" diff --git a/translations/message.pot b/translations/message.pot index c8809c9..41bc0e8 100644 --- a/translations/message.pot +++ b/translations/message.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,281 +47,281 @@ msgstr "" msgid "Start" msgstr "" -#: advanced.py:250 batch.py:57 setting.py:186 +#: advanced.py:250 batch.py:70 setting.py:186 msgid "Input Format" msgstr "" -#: advanced.py:261 advanced.py:713 batch.py:58 setting.py:380 +#: advanced.py:261 advanced.py:714 batch.py:71 setting.py:380 msgid "Target Language" msgstr "" -#: advanced.py:277 batch.py:57 +#: advanced.py:277 batch.py:70 msgid "Encoding" msgstr "" -#: advanced.py:368 +#: advanced.py:369 msgid "Failed to translate {} paragraph(s), Would you like to retry?" msgstr "" -#: advanced.py:374 lib/translation.py:266 +#: advanced.py:375 lib/translation.py:266 msgid "Translation completed." msgstr "" -#: advanced.py:389 +#: advanced.py:390 msgid "There is no content that needs to be translated." msgstr "" -#: advanced.py:437 +#: advanced.py:438 msgid "Loading ebook data, please wait..." msgstr "" -#: advanced.py:466 +#: advanced.py:467 msgid "Review" msgstr "" -#: advanced.py:467 +#: advanced.py:468 msgid "Log" msgstr "" -#: advanced.py:468 +#: advanced.py:469 msgid "Errors" msgstr "" -#: advanced.py:494 +#: advanced.py:495 msgid "All" msgstr "" -#: advanced.py:496 components/indicator.py:14 +#: advanced.py:497 components/indicator.py:14 msgid "Non-aligned" msgstr "" -#: advanced.py:497 advanced.py:803 components/indicator.py:13 -#: components/table.py:94 +#: advanced.py:498 advanced.py:804 components/indicator.py:13 +#: components/table.py:96 msgid "Translated" msgstr "" -#: advanced.py:498 components/indicator.py:15 components/table.py:83 +#: advanced.py:499 components/indicator.py:15 components/table.py:85 msgid "Untranslated" msgstr "" -#: advanced.py:501 +#: advanced.py:502 msgid "keyword for filtering" msgstr "" -#: advanced.py:580 +#: advanced.py:582 msgid "Total items: {}" msgstr "" -#: advanced.py:581 lib/translation.py:240 +#: advanced.py:583 lib/translation.py:240 msgid "Character count: {}" msgstr "" -#: advanced.py:590 +#: advanced.py:592 msgid "Non-aligned items: {}" msgstr "" -#: advanced.py:624 cache.py:92 cache.py:182 components/engine.py:201 -#: components/table.py:164 +#: advanced.py:625 cache.py:96 cache.py:185 components/engine.py:201 +#: components/table.py:166 msgid "Delete" msgstr "" -#: advanced.py:625 +#: advanced.py:626 msgid "Translate All" msgstr "" -#: advanced.py:626 +#: advanced.py:627 msgid "Translate Selected" msgstr "" -#: advanced.py:651 advanced.py:666 +#: advanced.py:652 advanced.py:667 msgid "Stop" msgstr "" -#: advanced.py:656 +#: advanced.py:657 msgid "Are you sure you want to stop the translation progress?" msgstr "" -#: advanced.py:660 +#: advanced.py:661 msgid "Stopping..." msgstr "" -#: advanced.py:691 +#: advanced.py:692 msgid "Cache Status" msgstr "" -#: advanced.py:694 +#: advanced.py:695 msgid "Disabled" msgstr "" -#: advanced.py:694 +#: advanced.py:695 msgid "Enabled" msgstr "" -#: advanced.py:701 setting.py:339 +#: advanced.py:702 setting.py:339 msgid "Translation Engine" msgstr "" -#: advanced.py:707 batch.py:58 setting.py:379 +#: advanced.py:708 batch.py:71 setting.py:379 msgid "Source Language" msgstr "" -#: advanced.py:719 +#: advanced.py:720 msgid "Custom Ebook Title" msgstr "" -#: advanced.py:724 +#: advanced.py:725 msgid "By default, title metadata will be translated." msgstr "" -#: advanced.py:753 +#: advanced.py:754 msgid "Output Ebook" msgstr "" -#: advanced.py:755 +#: advanced.py:756 msgid "Output" msgstr "" -#: advanced.py:804 +#: advanced.py:805 msgid "The ebook has not been translated yet." msgstr "" -#: advanced.py:808 +#: advanced.py:809 msgid "" "The number of lines in some translation units differs between the original " "text and the translated text. Are you sure you want to output without " "checking alignment?" msgstr "" -#: advanced.py:843 +#: advanced.py:844 msgid "No translation yet" msgstr "" -#: advanced.py:895 components/engine.py:207 setting.py:98 +#: advanced.py:896 components/engine.py:207 setting.py:98 msgid "Save" msgstr "" -#: advanced.py:974 +#: advanced.py:972 msgid "Your changes have been saved." msgstr "" -#: advanced.py:986 +#: advanced.py:985 msgid "Translation log" msgstr "" -#: advanced.py:997 +#: advanced.py:996 msgid "Error log" msgstr "" -#: advanced.py:1017 +#: advanced.py:1016 msgid "Are you sure you want to translate all {:n} paragraphs?" msgstr "" -#: advanced.py:1045 +#: advanced.py:1044 msgid "Are you sure you want to cancel the preparation progress?" msgstr "" -#: advanced.py:1056 +#: advanced.py:1055 msgid "Are you sure you want to cancel the translation progress?" msgstr "" -#: batch.py:57 setting.py:187 +#: batch.py:70 setting.py:187 msgid "Output Format" msgstr "" -#: batch.py:57 cache.py:202 +#: batch.py:70 cache.py:205 msgid "Title" msgstr "" -#: batch.py:80 +#: batch.py:92 msgid "Default" msgstr "" -#: batch.py:140 components/engine.py:138 components/table.py:162 +#: batch.py:156 components/engine.py:138 components/table.py:164 msgid "Translate" msgstr "" -#: batch.py:151 lib/cache.py:126 +#: batch.py:167 lib/cache.py:126 msgid "Unknown" msgstr "" -#: batch.py:160 cache.py:130 setting.py:1187 +#: batch.py:176 cache.py:133 setting.py:1187 msgid "The specified path does not exist." msgstr "" -#: cache.py:72 +#: cache.py:76 msgid "Choose a path to store cache files." msgstr "" -#: cache.py:73 +#: cache.py:77 msgid "Move" msgstr "" -#: cache.py:74 +#: cache.py:78 msgid "Reset" msgstr "" -#: cache.py:75 +#: cache.py:79 msgid "Reveal" msgstr "" -#: cache.py:77 +#: cache.py:81 msgid "Cache Path" msgstr "" -#: cache.py:90 +#: cache.py:94 msgid "Clear All" msgstr "" -#: cache.py:110 +#: cache.py:113 msgid "" "All cache(s) will be moved to the default path. Are you sure to proceed?" msgstr "" -#: cache.py:125 +#: cache.py:128 msgid "All cache(s) will be moved to the new path. Are you sure to proceed?" msgstr "" -#: cache.py:133 +#: cache.py:136 msgid "Please choose an empty folder." msgstr "" -#: cache.py:143 +#: cache.py:146 msgid "Are you sure you want to clear all caches?" msgstr "" -#: cache.py:153 +#: cache.py:156 msgid "No cache exists." msgstr "" -#: cache.py:158 +#: cache.py:161 msgid "Total: {}" msgstr "" -#: cache.py:189 +#: cache.py:192 msgid "Are you sure you want to delete the selected cache(s)?" msgstr "" -#: cache.py:202 components/table.py:40 setting.py:63 +#: cache.py:205 components/table.py:40 setting.py:63 msgid "Engine" msgstr "" -#: cache.py:202 components/table.py:40 +#: cache.py:205 components/table.py:40 msgid "Language" msgstr "" -#: cache.py:202 +#: cache.py:205 msgid "Merge Length" msgstr "" -#: cache.py:203 +#: cache.py:206 msgid "Filename" msgstr "" -#: cache.py:203 +#: cache.py:206 msgid "Last Modification Time" msgstr "" -#: cache.py:203 +#: cache.py:206 msgid "Size (MB)" msgstr "" @@ -374,6 +374,14 @@ msgstr "" msgid "The setting has been saved." msgstr "" +#: components/footer.py:31 +msgid "Feedback" +msgstr "" + +#: components/footer.py:32 +msgid "Donate" +msgstr "" + #: components/format.py:27 setting.py:196 msgid "Ebook Specific" msgstr "" @@ -386,14 +394,6 @@ msgstr "" msgid "Not selected" msgstr "" -#: components/info.py:35 -msgid "Donate" -msgstr "" - -#: components/info.py:35 -msgid "Feedback" -msgstr "" - #: components/lang.py:34 engines/base.py:71 setting.py:1249 msgid "Auto detect" msgstr "" @@ -402,7 +402,7 @@ msgstr "" msgid "Choose a translation mode for clicking the icon button." msgstr "" -#: components/mode.py:33 setting.py:115 ui.py:52 ui.py:80 +#: components/mode.py:33 setting.py:115 ui.py:52 ui.py:81 msgid "Advanced Mode" msgstr "" @@ -417,7 +417,7 @@ msgstr "" msgid "Choose" msgstr "" -#: components/mode.py:43 setting.py:116 ui.py:53 ui.py:107 +#: components/mode.py:43 setting.py:116 ui.py:53 ui.py:108 msgid "Batch Mode" msgstr "" @@ -435,21 +435,21 @@ msgstr "" msgid "Status" msgstr "" -#: components/table.py:141 +#: components/table.py:143 msgid "" "The number of lines differs between the original text and the translated " "text." msgstr "" -#: components/table.py:169 +#: components/table.py:171 msgid "Select the whole chapter" msgstr "" -#: components/table.py:175 +#: components/table.py:177 msgid "Select similar paragraphs: {}=\"{}\"" msgstr "" -#: components/table.py:254 +#: components/table.py:256 msgid "Retain at least one row." msgstr "" @@ -772,7 +772,7 @@ msgstr "" msgid "Usage Tip" msgstr "" -#: setting.py:364 setting.py:1009 setting.py:1052 setting.py:1111 +#: setting.py:364 setting.py:1009 setting.py:1027 setting.py:1070 #: setting.py:1128 msgid "Tip: " msgstr "" @@ -905,7 +905,7 @@ msgstr "" msgid "Original Text Color" msgstr "" -#: setting.py:905 setting.py:923 setting.py:1001 setting.py:1102 +#: setting.py:905 setting.py:923 setting.py:1001 setting.py:1018 #: setting.py:1120 msgid "e.g.," msgstr "" @@ -935,65 +935,65 @@ msgid "Stop further extraction once elements match these rules." msgstr "" #: setting.py:1014 +msgid "Ignore Element" +msgstr "" + +#: setting.py:1024 +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "" + +#: setting.py:1028 +msgid "Do not translation elements that matches these rules." +msgstr "" + +#: setting.py:1032 msgid "Ignore Paragraph" msgstr "" -#: setting.py:1020 +#: setting.py:1038 msgid "Scope" msgstr "" -#: setting.py:1021 +#: setting.py:1039 msgid "Text only" msgstr "" -#: setting.py:1023 +#: setting.py:1041 msgid "HTML element" msgstr "" -#: setting.py:1030 +#: setting.py:1048 msgid "Mode" msgstr "" -#: setting.py:1031 +#: setting.py:1049 msgid "Normal" msgstr "" -#: setting.py:1033 +#: setting.py:1051 msgid "Normal (case-sensitive)" msgstr "" -#: setting.py:1034 +#: setting.py:1052 msgid "Regular Expression" msgstr "" -#: setting.py:1053 -msgid "Do not translate elements that contain these keywords." +#: setting.py:1070 +msgid "Do not translate extracted elements that contain these rules." msgstr "" -#: setting.py:1079 +#: setting.py:1097 msgid "Exclude paragraph by keyword. One keyword per line:" msgstr "" -#: setting.py:1080 +#: setting.py:1098 msgid "Exclude paragraph by case-sensitive keyword. One keyword per line:" msgstr "" -#: setting.py:1082 +#: setting.py:1100 msgid "Exclude paragraph by regular expression pattern. One pattern per line:" msgstr "" -#: setting.py:1098 -msgid "Ignore Element" -msgstr "" - -#: setting.py:1108 -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "" - -#: setting.py:1112 -msgid "Do not translation elements that matches these rules." -msgstr "" - #: setting.py:1116 msgid "Reserve Element" msgstr "" @@ -1074,34 +1074,34 @@ msgstr "" msgid "Translate Ebook Content" msgstr "" -#: ui.py:56 ui.py:124 +#: ui.py:57 ui.py:125 msgid "Setting" msgstr "" -#: ui.py:57 ui.py:152 +#: ui.py:58 ui.py:153 msgid "About" msgstr "" -#: ui.py:88 +#: ui.py:89 msgid "Please choose one single book." msgstr "" -#: ui.py:101 +#: ui.py:102 msgid "Please choose at least one book." msgstr "" -#: ui.py:115 +#: ui.py:116 msgid "Cannot change setting while book(s) are under translation." msgstr "" -#: ui.py:132 +#: ui.py:133 msgid "Cannot manage cache while book(s) are under translation." msgstr "" -#: ui.py:141 +#: ui.py:142 msgid "Cache Manager" msgstr "" -#: ui.py:170 +#: ui.py:171 msgid "Choose Translation Mode" msgstr "" diff --git a/translations/pt.po b/translations/pt.po index 2580720..2be6476 100644 --- a/translations/pt.po +++ b/translations/pt.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: none\n" @@ -288,6 +288,12 @@ msgstr "O nome do mecanismo já está em uso." msgid "The setting has been saved." msgstr "As alterações foram salvas." +msgid "Feedback" +msgstr "Opinião" + +msgid "Donate" +msgstr "Doar" + msgid "Ebook Specific" msgstr "Ebook Específico" @@ -297,12 +303,6 @@ msgstr "" msgid "Not selected" msgstr "" -msgid "Donate" -msgstr "Doar" - -msgid "Feedback" -msgstr "Opinião" - msgid "Auto detect" msgstr "Auto detectar" @@ -714,6 +714,15 @@ msgstr "" msgid "Stop further extraction once elements match these rules." msgstr "" +msgid "Ignore Element" +msgstr "Ignorar Elemento" + +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "Seletores CSS para excluir elementos. Uma regra por linha:" + +msgid "Do not translation elements that matches these rules." +msgstr "" + msgid "Ignore Paragraph" msgstr "Ignorar Parágrafo" @@ -738,7 +747,7 @@ msgstr "Normal (diferencia maiúsculas de minúsculas)" msgid "Regular Expression" msgstr "Expressão Regular" -msgid "Do not translate elements that contain these keywords." +msgid "Do not translate extracted elements that contain these rules." msgstr "" msgid "Exclude paragraph by keyword. One keyword per line:" @@ -753,15 +762,6 @@ msgid "Exclude paragraph by regular expression pattern. One pattern per line:" msgstr "" "Excluir parágrafo por padrão de expressão regular. Um padrão por linha:" -msgid "Ignore Element" -msgstr "Ignorar Elemento" - -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "Seletores CSS para excluir elementos. Uma regra por linha:" - -msgid "Do not translation elements that matches these rules." -msgstr "" - msgid "Reserve Element" msgstr "" diff --git a/translations/tr.po b/translations/tr.po index f97a3fd..84015c9 100644 --- a/translations/tr.po +++ b/translations/tr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: 2024-03-23 15:12+0300\n" "Last-Translator: DogancanYr \n" "Language-Team: Turkish \n" @@ -288,6 +288,12 @@ msgstr "Motor adı zaten kullanılıyor." msgid "The setting has been saved." msgstr "Ayar kaydedildi." +msgid "Feedback" +msgstr "Geri bildirim" + +msgid "Donate" +msgstr "Bağış yap" + msgid "Ebook Specific" msgstr "E-kitaba Özel" @@ -297,12 +303,6 @@ msgstr "" msgid "Not selected" msgstr "" -msgid "Donate" -msgstr "Bağış yap" - -msgid "Feedback" -msgstr "Geri bildirim" - msgid "Auto detect" msgstr "Otomatik algılama" @@ -716,6 +716,15 @@ msgstr "" msgid "Stop further extraction once elements match these rules." msgstr "" +msgid "Ignore Element" +msgstr "Öğeyi Yoksay" + +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "Öğeleri dışlamak için CSS seçicileri. " + +msgid "Do not translation elements that matches these rules." +msgstr "" + msgid "Ignore Paragraph" msgstr "Paragrafı Yoksay" @@ -740,7 +749,7 @@ msgstr "Normal (büyük/küçük harfe duyarlı)" msgid "Regular Expression" msgstr "Normal İfade" -msgid "Do not translate elements that contain these keywords." +msgid "Do not translate extracted elements that contain these rules." msgstr "" msgid "Exclude paragraph by keyword. One keyword per line:" @@ -752,15 +761,6 @@ msgstr "Paragrafı büyük/küçük harfe duyarlı anahtar sözcükle hariç tut msgid "Exclude paragraph by regular expression pattern. One pattern per line:" msgstr "Paragrafı normal ifade düzeniyle hariç tut. " -msgid "Ignore Element" -msgstr "Öğeyi Yoksay" - -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "Öğeleri dışlamak için CSS seçicileri. " - -msgid "Do not translation elements that matches these rules." -msgstr "" - msgid "Reserve Element" msgstr "" diff --git a/translations/zh_CN.mo b/translations/zh_CN.mo index a7f8e8d..0dcd5dc 100644 Binary files a/translations/zh_CN.mo and b/translations/zh_CN.mo differ diff --git a/translations/zh_CN.po b/translations/zh_CN.po index c3513ee..b1cb894 100644 --- a/translations/zh_CN.po +++ b/translations/zh_CN.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: 2023-04-17 14:17+0800\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -284,6 +284,12 @@ msgstr "引擎名称已使用。" msgid "The setting has been saved." msgstr "设置已保存。" +msgid "Feedback" +msgstr "反馈" + +msgid "Donate" +msgstr "捐助" + msgid "Ebook Specific" msgstr "自动选择" @@ -293,12 +299,6 @@ msgstr "翻译失败" msgid "Not selected" msgstr "未选中" -msgid "Donate" -msgstr "捐助" - -msgid "Feedback" -msgstr "反馈" - msgid "Auto detect" msgstr "自动探测" @@ -703,6 +703,15 @@ msgstr "首选元素 CSS 选择器。一行一条规则:" msgid "Stop further extraction once elements match these rules." msgstr "一旦某元素匹配此规则停止进一步抽取。" +msgid "Ignore Element" +msgstr "忽略元素" + +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "用来排除元素的 CSS 选择器。一行一条规则:" + +msgid "Do not translation elements that matches these rules." +msgstr "不要翻译匹配这些规则的元素。" + msgid "Ignore Paragraph" msgstr "忽略段落" @@ -727,8 +736,8 @@ msgstr "普通(区分大小写)" msgid "Regular Expression" msgstr "正则表达式" -msgid "Do not translate elements that contain these keywords." -msgstr "不要翻译包含这些关键词的元素。" +msgid "Do not translate extracted elements that contain these rules." +msgstr "不要翻译已抽取元素中包含这些关键词的元素。" msgid "Exclude paragraph by keyword. One keyword per line:" msgstr "排除带指定关键词的段落。一行一条关键词:" @@ -739,15 +748,6 @@ msgstr "排除带指定关键词的段落(区分字母大小写)。一行一 msgid "Exclude paragraph by regular expression pattern. One pattern per line:" msgstr "排除匹配正则表达式规则的段落。一行一条规则:" -msgid "Ignore Element" -msgstr "忽略元素" - -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "用来排除元素的 CSS 选择器。一行一条规则:" - -msgid "Do not translation elements that matches these rules." -msgstr "不要翻译匹配这些规则的元素。" - msgid "Reserve Element" msgstr "保留元素" diff --git a/translations/zh_TW.po b/translations/zh_TW.po index 0b786b9..4191107 100644 --- a/translations/zh_TW.po +++ b/translations/zh_TW.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Ebook Translator Calibre Plugin\n" "Report-Msgid-Bugs-To: bookfere@gmail.com\n" -"POT-Creation-Date: 2024-04-13 10:33+0800\n" +"POT-Creation-Date: 2024-04-13 18:31+0800\n" "PO-Revision-Date: 2023-04-25 15:36+0800\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -285,6 +285,12 @@ msgstr "引擎名稱已經被使用。" msgid "The setting has been saved." msgstr "設定已儲存。" +msgid "Feedback" +msgstr "回饋" + +msgid "Donate" +msgstr "捐助" + msgid "Ebook Specific" msgstr "" @@ -294,12 +300,6 @@ msgstr "" msgid "Not selected" msgstr "" -msgid "Donate" -msgstr "捐助" - -msgid "Feedback" -msgstr "回饋" - msgid "Auto detect" msgstr "自動偵測" @@ -699,6 +699,15 @@ msgstr "" msgid "Stop further extraction once elements match these rules." msgstr "" +msgid "Ignore Element" +msgstr "" + +msgid "CSS selectors to exclude elements. One rule per line:" +msgstr "" + +msgid "Do not translation elements that matches these rules." +msgstr "" + msgid "Ignore Paragraph" msgstr "忽略段落" @@ -723,7 +732,7 @@ msgstr "一般 (區分大小寫)" msgid "Regular Expression" msgstr "規則運算式" -msgid "Do not translate elements that contain these keywords." +msgid "Do not translate extracted elements that contain these rules." msgstr "" msgid "Exclude paragraph by keyword. One keyword per line:" @@ -735,15 +744,6 @@ msgstr "依關鍵字排除段落 (區分大小寫)。每行一條關鍵字:" msgid "Exclude paragraph by regular expression pattern. One pattern per line:" msgstr "依規則運算式模式排除段落。每行一條模式:" -msgid "Ignore Element" -msgstr "" - -msgid "CSS selectors to exclude elements. One rule per line:" -msgstr "" - -msgid "Do not translation elements that matches these rules." -msgstr "" - msgid "Reserve Element" msgstr ""