diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 317fcf417..ba29319d7 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -168,6 +168,19 @@ void QETApp::setLanguage(const QString &desired_language) { } } installTranslator(&qetTranslator); + + QString ltr_special_string = tr( + "LTR", + "Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR" + ); + if (ltr_special_string == "RTL") switchLayout(Qt::RightToLeft); +} + +/** + Switches the application to the provided layout. +*/ +void QETApp::switchLayout(Qt::LayoutDirection direction) { + setLayoutDirection(direction); } /** diff --git a/sources/qetapp.h b/sources/qetapp.h index bcd2e6720..82c9504f1 100644 --- a/sources/qetapp.h +++ b/sources/qetapp.h @@ -62,6 +62,7 @@ class QETApp : public QETSingleApplication { public: static QETApp *instance(); void setLanguage(const QString &); + void switchLayout(Qt::LayoutDirection); static void printHelp(); static void printVersion(); static void printLicense();