Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "qmltranslator.h"
- #include <QGuiApplication>
- QmlTranslator::QmlTranslator(QObject *parent) : QObject(parent)
- {
- }
- void QmlTranslator::setTranslation(QString translation)
- {
- m_translator.load(":/QmlLanguage_" + translation, "."); // load translation
- qApp->installTranslator(&m_translator); // Set it to the application
- emit languageChanged(); // Signaling a change in the current translation
- }
Add Comment
Please, Sign In to add comment