2#include <NDEVR/Translator.h>
4#include <QSyntaxHighlighter>
5#include <QRegularExpression>
8 class LanguageEditorUI;
41 struct HighlightingRule
43 QRegularExpression pattern;
44 QTextCharFormat format;
46 QVector<HighlightingRule> m_highlighting_rules;
71#if SUPPORTS_GOOGLE_TRANSLATE
79 QString googleTranslate(
const QString& keyword,
const QString& from,
const QString& to)
const;
105 Ui::LanguageEditorUI*
ui;
Translator m_reference_translator
The reference translator for comparison.
Translator m_original_translator
The original translator state before edits.
void copyReference()
Copies the reference translation values into the editing translator.
void updateTranslationView()
Updates the translation view panel with the current entries.
void setEditingTranslation(const Translator &translator)
Sets the translator currently being edited.
bool m_has_change
Whether unsaved changes exist.
void setReferenceTranslation(const Translator &translator)
Sets the reference translator to compare against while editing.
void saveLanguage()
Saves the current translation edits to disk.
void updateUI()
Refreshes the editor UI to reflect the current state.
Translator m_translator
The translator currently being edited.
LanguageEditor(QWidget *parent=nullptr)
Constructs a LanguageEditor widget.
Ui::LanguageEditorUI * ui
The auto-generated UI form for the editor.
bool canSave()
Returns whether the current edits can be saved.
LanguageHighlighter(QTextDocument *parent=0)
Constructs a LanguageHighlighter for the given text document.
void highlightBlock(const QString &text) override
Applies highlighting rules to the given block of text.
void setSearchString(const QString &search_string)
Sets the search string to highlight in the translation text.
Provides language translation services for the application.
The primary namespace for the NDEVR SDK.