diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2268522b..116f9d68 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,7 +12,7 @@ jobs: - name: Install Deps uses: mstksg/get-package@master with: - apt-get: build-essential openssh-client libopenscap-dev libqt5xmlpatterns5-dev ssh-askpass asciidoc libpolkit-agent-1-0 + apt-get: build-essential openssh-client libopenscap-dev libqt5xmlpatterns5-dev ssh-askpass asciidoc libpolkit-agent-1-0 qttools5-dev-tools - name: Checkout uses: actions/checkout@v2 - name: Build @@ -30,7 +30,7 @@ jobs: image: fedora:33 steps: - name: Install Deps - run: dnf install -y cmake gcc-c++ openssh-clients util-linux openscap-devel qt5-qtbase-devel qt5-qtxmlpatterns-devel openssh-askpass asciidoc polkit-libs + run: dnf install -y cmake gcc-c++ openssh-clients util-linux openscap-devel qt5-qtbase-devel qt5-qtxmlpatterns-devel openssh-askpass asciidoc polkit-libs qt5-linguist - name: Checkout uses: actions/checkout@v2 - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index 77bb3ae9..6c7240f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ include(GNUInstallDirs) set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5XmlPatterns REQUIRED) +find_package(Qt5LinguistTools REQUIRED) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) @@ -159,7 +160,7 @@ set(scap_workbench_LANGUAGES) set(scap_workbench_LANGUAGE_TS_FILES) foreach(LANGUAGE ${scap_workbench_LANGUAGES}) - set(TS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/i18n/${LANGUAGE}.ts") + set(TS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/i18n/scap-workbench.${LANGUAGE}.ts") set(scap_workbench_LANGUAGE_TS_FILES ${scap_workbench_LANGUAGE_TS_FILES} ${TS_FILE}) set_source_files_properties(${TS_FILE} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/i18n") endforeach() @@ -183,7 +184,7 @@ add_executable("scap-workbench" MACOSX_BUNDLE ${scap_workbench_HEADERS_MOC} ${scap_workbench_UIS_HEADERS} - ${scap_workbench_LANGUAGE_TS_FILES} + ${qm_files} ) set_target_properties("scap-workbench" PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in) @@ -300,6 +301,9 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" DESTINATION ${CMAKE_INSTALL_DOCDIR}) +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/i18n" + DESTINATION "${CMAKE_INSTALL_DATADIR}/scap-workbench") + if (CPPCHECK_EXECUTABLE) set(CPPCHECK_INCL_PARAMS -I /usr/include) foreach(DIR ${SCAP_WORKBENCH_INCLUDE_DIRS}) diff --git a/src/Application.cpp b/src/Application.cpp index e5d822a0..72df8c36 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -43,13 +43,14 @@ Application::Application(int& argc, char** argv): setApplicationDisplayName("SCAP Workbench"); setApplicationVersion(SCAP_WORKBENCH_VERSION); - mMainWindow = new MainWindow(); - #if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) - mTranslator.load(QLocale(), "scap-workbench", "", getShareTranslationDirectory().absolutePath()); + mTranslator.load(QLocale(), "scap-workbench", ".", getShareTranslationDirectory().absolutePath()); installTranslator(&mTranslator); #endif + // create the main window after loading any translations so it loads properly + mMainWindow = new MainWindow(); + const QIcon& icon = getApplicationIcon(); setWindowIcon(icon); mMainWindow->setWindowIcon(icon);