🐛 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

@ -25,13 +25,13 @@ jobs:
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.6
with: with:
key: win-conan-${{ hashFiles('**/conanfile.txt') }} key: win-conan-${{ hashFiles('**/conanfile.txt') }}
path: ~/.conan/ path: ~/.conan/
- name: Cache Qt - name: Cache Qt
id: cache-qt id: cache-qt
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.6
with: with:
path: '${{ github.workspace }}/qt/' path: "${{ github.workspace }}/qt/"
key: ${{ runner.os }}-QtCache key: ${{ runner.os }}-QtCache
- name: Install Qt - name: Install Qt
@ -39,19 +39,19 @@ jobs:
with: with:
cached: ${{ steps.cache-qt.outputs.cache-hit }} cached: ${{ steps.cache-qt.outputs.cache-hit }}
modules: qtwebengine modules: qtwebengine
dir: '${{ github.workspace }}/qt/' dir: "${{ github.workspace }}/qt/"
- name: Export qtkeychain - name: Export qtkeychain
run: | run: |
conan export recipes/qtkeychain conan export recipes/qtkeychain
- name: Build - name: Build
run: | run: |
mkdir build mkdir build
cd build cd build
conan install .. --build=missing conan install .. --build=missing
cmake -G"NMake Makefiles JOM" -DCMAKE_INSTALL_PREFIX=redist .. cmake -G"NMake Makefiles JOM" -DCMAKE_INSTALL_PREFIX=redist ..
jom jom
shell: cmd shell: cmd
- name: Install - name: Install
@ -77,12 +77,12 @@ jobs:
- name: Install qt - name: Install qt
run: | run: |
sudo apt-get update 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 - name: Build
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Release .. cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4 make -j4
shell: bash shell: bash

View File

@ -82,8 +82,11 @@ set(HEADERS
src/WorkspaceCommon.h) src/WorkspaceCommon.h)
file(COPY rsrc/languages.qrc DESTINATION ${CMAKE_BINARY_DIR}/intl)
set(RESOURCES set(RESOURCES
rsrc/resources.qrc) rsrc/resources.qrc
${CMAKE_BINARY_DIR}/intl/languages.qrc)
set(TRANSLATIONS set(TRANSLATIONS
intl/en_US.ts intl/en_US.ts
@ -97,7 +100,7 @@ set(TRANSLATIONS
intl/nl_NL.ts intl/nl_NL.ts
intl/ko_KR.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) find_package(Qt5LinguistTools)
if (Qt5LinguistTools_FOUND) if (Qt5LinguistTools_FOUND)
@ -106,7 +109,6 @@ if (Qt5LinguistTools_FOUND)
else () else ()
qt5_add_translation(QM_FILES ${TRANSLATIONS}) qt5_add_translation(QM_FILES ${TRANSLATIONS})
endif () endif ()
install(FILES ${QM_FILES} DESTINATION ./translations)
else () else ()
message("Qt5LinguistTools not found") message("Qt5LinguistTools not found")
endif () endif ()
@ -144,10 +146,13 @@ endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE FUEL_VERSION="${PROJECT_VERSION}") target_compile_definitions(${PROJECT_NAME} PRIVATE FUEL_VERSION="${PROJECT_VERSION}")
# ------------------------------------------------------------------------------------------------# # ------------------------------------------------------------------------------------------------#
# Cpack # Cpack
# ------------------------------------------------------------------------------------------------# # ------------------------------------------------------------------------------------------------#
include(GNUInstallDirs)
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
set(CPACK_PACKAGE_DESCRIPTION "A GUI front-end for the Fossil SCM") 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_GENERATOR ${CPACK_GENERATOR};WIX)
set(CPACK_MODULE_PATH "") set(CPACK_MODULE_PATH "")
endif () 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) include(CPack)
feature_summary(WHAT ALL) feature_summary(WHAT ALL)

View File

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

View File

@ -1,10 +1,9 @@
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8
Type=Application Type=Application
Exec=/usr/bin/fuel Exec=Fuel
Icon=/usr/share/icons/hicolor/256x256/apps/fuel.png Icon=fuel
Terminal=false Terminal=false
Name=Fuel Name=Fuel
GenericName=Software Configuration Management tool GenericName=Software Configuration Management tool
Comment=GUI Front-End to the Fossil SCM 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 In-01.png</file>
<file>icons/Zoom Out-01.png</file> <file>icons/Zoom Out-01.png</file>
</qresource> </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"> <qresource prefix="/docs">
<file>docs/Translators.txt</file> <file>docs/Translators.txt</file>
<file>docs/Licenses.txt</file> <file>docs/Licenses.txt</file>

View File

@ -75,7 +75,7 @@ bool Settings::InstallLang(const QString &langId)
return true; 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)) if(!translator.load(locale_path))
return false; return false;