Füge Unterstützung für die Massenübersetzung hinzu und verbessere die Platzhalterbehandlung
This commit is contained in:
16
mainwindow.h
Normal file → Executable file
16
mainwindow.h
Normal file → Executable file
@@ -41,6 +41,7 @@ private slots:
|
||||
void onDeeplTranslationPossibilitiesLoaded(QNetworkReply *reply);
|
||||
void on_deeplTranslateFrom_currentTextChanged(const QString &sourceLanguage);
|
||||
void on_autoTranslateButton_clicked();
|
||||
void on_bulkAutoTranslateButton_clicked();
|
||||
void on_searchButton_clicked();
|
||||
void on_searchNextButton_clicked();
|
||||
void on_deeplApiKey_editingFinished();
|
||||
@@ -58,6 +59,12 @@ private:
|
||||
QString oldText;
|
||||
QString newText;
|
||||
};
|
||||
struct BulkTranslationItem {
|
||||
QTreeWidgetItem *item;
|
||||
QString originalText;
|
||||
QString translatedText;
|
||||
QVector<QString> placeholders;
|
||||
};
|
||||
std::unique_ptr<QNetworkAccessManager> networkManager;
|
||||
Ui::MainWindow *ui;
|
||||
QJsonObject configuration;
|
||||
@@ -76,10 +83,19 @@ private:
|
||||
void loadDeeplTranslationPossibilities();
|
||||
void renderDeeplSources();
|
||||
void translationRequestFinished(QNetworkReply *reply);
|
||||
void requestNextBulkTranslationBatch();
|
||||
void handleBulkTranslationReply(QNetworkReply *reply, int firstItem, int itemCount);
|
||||
void showBulkTranslationDialog();
|
||||
void onDeeplTranslationAuthenticationError(QNetworkReply *reply, QAuthenticator *authenticator);
|
||||
void countAndShowUntranslated();
|
||||
void searchNext();
|
||||
QVector<TranslationItem> parseTextBlock(const QString &block);
|
||||
void setConfigValue(const QString &key, const QString &value);
|
||||
// DeepL placeholder protection: maps tag id -> original placeholder text
|
||||
QVector<QString> deeplPlaceholderMap;
|
||||
QString protectPlaceholdersForDeepl(const QString &input);
|
||||
QString restorePlaceholdersFromDeepl(const QString &input);
|
||||
QVector<BulkTranslationItem> bulkTranslations;
|
||||
int nextBulkTranslationIndex{0};
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user