The application now uses right-to-left layouts when required by translations through a special, non-displayed translated string.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1518 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier 2012-02-20 21:20:34 +00:00
parent 007e627b86
commit 0815332c73
2 changed files with 14 additions and 0 deletions

View File

@ -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);
}
/**

View File

@ -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();