Skip to content

Commit

Permalink
Windows translations deployment (#274)
Browse files Browse the repository at this point in the history
* fix deployment of translations to install path

* ConnectionWindow: fix qmlplugindump choking on list property

* ConnectionWindow: make LanguageButton smooth

* build: deploy translations on Windows

* translations: fix broken call on windows
  • Loading branch information
machinekoder committed Jul 3, 2018
1 parent 24440bc commit ff09566
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions apps/MachinekitClient/translation.pri
Expand Up @@ -11,17 +11,17 @@ TRANSLATIONS = $$prependAll(LANGUAGES, $${TRANSLATIONS_PATH}/$${TARGET_NAME}_, .
TRANSLATIONS_OUT = $$prependAll(LANGUAGES, $${OUTPUT_DIR}/$${TARGET_NAME}_, .qm)

isEmpty(QMAKE_LUPDATE) {
win32:QMAKE_LUPDATE = $$[QT_INSTALL_BINS]\lupdate.exe
else:QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate
win32:QMAKE_LUPDATE = $$shell_path($$[QT_INSTALL_BINS]\lupdate.exe)
else:QMAKE_LUPDATE = $$shell_path($$[QT_INSTALL_BINS]/lupdate)
}

for(a,TRANSLATIONS): {
system($$QMAKE_LUPDATE $$join(QML_FILES, " ") -locations none -no-ui-lines -ts $${a})
}

isEmpty(QMAKE_LRELEASE) {
win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
win32:QMAKE_LRELEASE = $$shell_path($$[QT_INSTALL_BINS]\lrelease.exe)
else:QMAKE_LRELEASE = $$shell_path($$[QT_INSTALL_BINS]/lrelease)
}
updateqm.input = TRANSLATIONS
updateqm.output = $${OUTPUT_DIR}/${QMAKE_FILE_BASE}.qm
Expand Down
3 changes: 2 additions & 1 deletion build/appveyor/appveyor.bat
Expand Up @@ -94,6 +94,7 @@ mkdir MachinekitClient
cd MachinekitClient
cp ../apps/MachinekitClient/release/machinekit-client.exe . || goto :error
windeployqt --angle --release --qmldir ../../apps/MachinekitClient/ machinekit-client.exe || goto :error
cp ../translations/*.qm translations/ || goto :error
cp %QTDIR%\bin\libzmq.dll . || goto :error
cd .. || goto :error
7z a MachinekitClient.zip MachinekitClient/ || goto :error
Expand All @@ -102,7 +103,7 @@ mkdir qml
mkdir lib
cp -r %QTDIR%/qml/Machinekit qml/ || goto :error
cp -r %QTDIR%/bin/libzmq.dll lib/ || goto :error
7z a QtQuickVcp.zip qml/ lib/ || goto :error
7z a QtQuickVcp.zip qml/ lib/ translations/ || goto :error

:: rename deployment files
set platform=%ARCH%
Expand Down
2 changes: 1 addition & 1 deletion src/applicationcontrols/ConnectionWindow.qml
Expand Up @@ -180,7 +180,7 @@ Rectangle {

/*! This property holds the list of local applications.
*/
default property list<ApplicationDescription> applications
default property var applications: []

/*!
\qmlproperty Item toolBar
Expand Down
1 change: 1 addition & 0 deletions src/applicationcontrols/Private/LanguageControlButton.qml
Expand Up @@ -9,6 +9,7 @@ Image {

id: root
fillMode: Image.PreserveAspectFit
smooth: true
source: "qrc:Machinekit/Application/Controls/icons/flag-" + activeLanguage
height: dummyButton.height

Expand Down
10 changes: 5 additions & 5 deletions src/translation.pri
Expand Up @@ -10,17 +10,17 @@ TRANSLATIONS = $$prependAll(LANGUAGES, $${TRANSLATIONS_PATH}/$${TARGET_NAME}_, .
TRANSLATIONS_OUT = $$prependAll(LANGUAGES, $${OUTPUT_DIR}/$${TARGET_NAME}_, .qm)

isEmpty(QMAKE_LUPDATE) {
win32:QMAKE_LUPDATE = $$[QT_INSTALL_BINS]\lupdate.exe
else:QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate
win32:QMAKE_LUPDATE = $$shell_path($$[QT_INSTALL_BINS]\lupdate.exe)
else:QMAKE_LUPDATE = $$shell_path($$[QT_INSTALL_BINS]/lupdate)
}

for(a,TRANSLATIONS): {
system($$QMAKE_LUPDATE $$join(QML_FILES, " ") -locations none -no-ui-lines -ts $${a})
}

isEmpty(QMAKE_LRELEASE) {
win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
win32:QMAKE_LRELEASE = $$shell_path($$[QT_INSTALL_BINS]\lrelease.exe)
else:QMAKE_LRELEASE = $$shell_path($$[QT_INSTALL_BINS]/lrelease)
}
updateqm.input = TRANSLATIONS
updateqm.output = $${OUTPUT_DIR}/${QMAKE_FILE_BASE}.qm
Expand All @@ -30,6 +30,6 @@ updateqm.CONFIG += no_link
updateqm.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += updateqm

updateqm_install.files = $${TRANSLATIONS_OUT}
updateqm_install.files = $$TRANSLATIONS_OUT
updateqm_install.path = $$[QT_INSTALL_TRANSLATIONS]
INSTALLS += updateqm_install

0 comments on commit ff09566

Please sign in to comment.