mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
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:
parent
007e627b86
commit
0815332c73
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user