diff --git a/designer/designersettingmanager.cpp b/designer/designersettingmanager.cpp index 925143f..6a353ab 100644 --- a/designer/designersettingmanager.cpp +++ b/designer/designersettingmanager.cpp @@ -15,6 +15,8 @@ void DesignerSettingManager::getAviableLanguages(QList* 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() diff --git a/designer/main.cpp b/designer/main.cpp index eeadf9b..3fcb4a9 100644 --- a/designer/main.cpp +++ b/designer/main.cpp @@ -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));