Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.733 kB
#ifndef RAZOR_TRANSLATE_H
#include <QtCore/QLocale>
#include <QtCore/QTranslator>
#include <QtCore/QLibraryInfo>
class RazorTranslator {
public:
static void translate()
{
QString locale = QLocale::system().name();
QTranslator *qtTranslator = new QTranslator(qApp);
qtTranslator->load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
qApp->installTranslator(qtTranslator);
QTranslator *appTranslator = new QTranslator(qApp);
appTranslator->load(QString("${TRANSLATIONS_DIR}/${PROJECT_NAME}_%1.qm").arg(locale));
qApp->installTranslator(appTranslator);
}
};
#define TRANSLATE_APP RazorTranslator::translate();
#endif // RAZOR_TRANSLATE_H
Jump to Line
Something went wrong with that request. Please try again.