#ifndef TRANSLATION_MANAGER_H
#define TRANSLATION_MANAGER_H

#include <QObject>
#include <QTranslator>
#include <QString>
#include <memory>

class TranslationManager : public QObject {
    Q_OBJECT
    Q_PROPERTY(int retranslateToken READ retranslateToken NOTIFY retranslateTokenChanged)
    Q_PROPERTY(QString language READ language NOTIFY languageChanged)

public:
    explicit TranslationManager(QObject* parent = nullptr);

    Q_INVOKABLE bool setLanguage(const QString& language);
    int retranslateToken() const { return m_retranslateToken; }
    QString language() const { return m_language; }

signals:
    void retranslateTokenChanged();
    void languageChanged();

private:
    std::unique_ptr<QTranslator> m_translator;
    QString m_language;
    int m_retranslateToken = 0;
};

#endif
