🐛 Fixed missing translations

This commit is contained in:
Edgar 2021-09-23 10:41:08 +02:00
parent f34ec61276
commit 2fe89789bc
7 changed files with 57 additions and 35 deletions

View File

@ -31,7 +31,7 @@ jobs:
id: cache-qt
uses: actions/cache@v2.1.6
with:
path: '${{ github.workspace }}/qt/'
path: "${{ github.workspace }}/qt/"
key: ${{ runner.os }}-QtCache
- name: Install Qt
@ -39,7 +39,7 @@ jobs:
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
modules: qtwebengine
dir: '${{ github.workspace }}/qt/'
dir: "${{ github.workspace }}/qt/"
- name: Export qtkeychain
run: |
@ -77,7 +77,7 @@ jobs:
- name: Install qt
run: |
sudo apt-get update
sudo apt-get install qt5keychain-dev qtwebengine5-dev -y
sudo apt-get install qt5keychain-dev qtwebengine5-dev qttools5-dev -y
- name: Build
run: |

View File

@ -82,8 +82,11 @@ set(HEADERS
src/WorkspaceCommon.h)
file(COPY rsrc/languages.qrc DESTINATION ${CMAKE_BINARY_DIR}/intl)
set(RESOURCES
rsrc/resources.qrc)
rsrc/resources.qrc
${CMAKE_BINARY_DIR}/intl/languages.qrc)
set(TRANSLATIONS
intl/en_US.ts
@ -97,7 +100,7 @@ set(TRANSLATIONS
intl/nl_NL.ts
intl/ko_KR.ts)
set_source_files_properties(${TRANSLATIONS} PROPERTIES OUTPUT_LOCATION "${RUNTIME_OUTPUT_DIRECTORY}translations")
set_source_files_properties(${TRANSLATIONS} PROPERTIES OUTPUT_LOCATION "intl")
find_package(Qt5LinguistTools)
if (Qt5LinguistTools_FOUND)
@ -106,7 +109,6 @@ if (Qt5LinguistTools_FOUND)
else ()
qt5_add_translation(QM_FILES ${TRANSLATIONS})
endif ()
install(FILES ${QM_FILES} DESTINATION ./translations)
else ()
message("Qt5LinguistTools not found")
endif ()
@ -144,10 +146,13 @@ endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE FUEL_VERSION="${PROJECT_VERSION}")
# ------------------------------------------------------------------------------------------------#
# Cpack
# ------------------------------------------------------------------------------------------------#
include(GNUInstallDirs)
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
set(CPACK_PACKAGE_DESCRIPTION "A GUI front-end for the Fossil SCM")
@ -201,6 +206,22 @@ if (WIN32)
set(CPACK_GENERATOR ${CPACK_GENERATOR};WIX)
set(CPACK_MODULE_PATH "")
endif ()
if(UNIX)
install(
TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_SOURCE_DIR}/rsrc/fuel.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications/
)
install(
FILES ${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/256x256/apps
)
endif()
include(CPack)
feature_summary(WHAT ALL)

View File

@ -57,6 +57,8 @@ exists( $$OUT_PWD/conanbuildinfo.pri ) {
message("Using conan packages")
CONFIG += conan_basic_setup
include($$OUT_PWD/conanbuildinfo.pri)
} else {
QT += Qt5Keychain
}
INCLUDEPATH += src

View File

@ -1,10 +1,9 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=/usr/bin/fuel
Icon=/usr/share/icons/hicolor/256x256/apps/fuel.png
Exec=Fuel
Icon=fuel
Terminal=false
Name=Fuel
GenericName=Software Configuration Management tool
Comment=GUI Front-End to the Fossil SCM tool
Categories=Qt;Development;RevisionControl
Categories=Development;RevisionControl;

13
rsrc/languages.qrc Normal file
View File

@ -0,0 +1,13 @@
<RCC>
<qresource prefix="/intl">
<file>el_GR.qm</file>
<file>de_DE.qm</file>
<file>es_ES.qm</file>
<file>fr_FR.qm</file>
<file>ru_RU.qm</file>
<file>pt_PT.qm</file>
<file>it_IT.qm</file>
<file>nl_NL.qm</file>
<file>ko_KR.qm</file>
</qresource>
</RCC>

View File

@ -156,19 +156,6 @@
<file>icons/Zoom In-01.png</file>
<file>icons/Zoom Out-01.png</file>
</qresource>
<!-->
<qresource prefix="/intl">
<file>intl/el_GR.qm</file>
<file>intl/de_DE.qm</file>
<file>intl/es_ES.qm</file>
<file>intl/fr_FR.qm</file>
<file>intl/ru_RU.qm</file>
<file>intl/pt_PT.qm</file>
<file>intl/it_IT.qm</file>
<file>intl/nl_NL.qm</file>
<file>intl/ko_KR.qm</file>
</qresource>
<-->
<qresource prefix="/docs">
<file>docs/Translators.txt</file>
<file>docs/Licenses.txt</file>

View File

@ -75,7 +75,7 @@ bool Settings::InstallLang(const QString &langId)
return true;
}
QString locale_path = QString(":intl/intl/%0.qm").arg(langId);
QString locale_path = QString(":intl/%0.qm").arg(langId);
if(!translator.load(locale_path))
return false;