mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-23 16:22:58 +03:00
designer translate ui fixed
This commit is contained in:
parent
b21a63e8a9
commit
d460a36e45
@ -15,6 +15,8 @@ void DesignerSettingManager::getAviableLanguages(QList<QLocale::Language>* langu
|
||||
languages->append(QLocale::Russian);
|
||||
languages->append(QLocale::English);
|
||||
languages->append(QLocale::Arabic);
|
||||
languages->append(QLocale::French);
|
||||
languages->append(QLocale::Chinese);
|
||||
}
|
||||
|
||||
QLocale::Language DesignerSettingManager::getCurrentDefaultLanguage()
|
||||
|
@ -9,24 +9,27 @@ int main(int argc, char *argv[])
|
||||
QApplication a(argc, argv);
|
||||
DesignerSettingManager manager;
|
||||
|
||||
LimeReport::ReportEngine report;
|
||||
|
||||
QTranslator limeReportTranslator;
|
||||
QTranslator qtTranslator;
|
||||
QString translationPath = QApplication::applicationDirPath();
|
||||
translationPath.append("/languages");
|
||||
|
||||
QString designerTranslation = QLocale(manager.getCurrentDefaultLanguage()).name();
|
||||
|
||||
limeReportTranslator.load("limereport_"+designerTranslation, translationPath);
|
||||
a.installTranslator(&limeReportTranslator);
|
||||
if (limeReportTranslator.load("limereport_"+designerTranslation, translationPath)){
|
||||
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load("qt_" + designerTranslation, translationPath);
|
||||
a.installTranslator(&qtTranslator);
|
||||
qtTranslator.load("qt_" + designerTranslation, translationPath);
|
||||
a.installTranslator(&qtTranslator);
|
||||
a.installTranslator(&limeReportTranslator);
|
||||
|
||||
Qt::LayoutDirection layoutDirection = QLocale(manager.getCurrentDefaultLanguage()).textDirection();
|
||||
Qt::LayoutDirection layoutDirection = QLocale(manager.getCurrentDefaultLanguage()).textDirection();
|
||||
|
||||
a.setLayoutDirection(layoutDirection);
|
||||
report.setPreviewLayoutDirection(layoutDirection);
|
||||
}
|
||||
|
||||
LimeReport::ReportEngine report;
|
||||
a.setLayoutDirection(layoutDirection);
|
||||
report.setPreviewLayoutDirection(layoutDirection);
|
||||
|
||||
if (a.arguments().count()>1){
|
||||
report.loadFromFile(a.arguments().at(1));
|
||||
|
Loading…
Reference in New Issue
Block a user