mirror of
https://github.com/c0re100/qBittorrent-Enhanced-Edition.git
synced 2025-01-05 10:27:31 +08:00
qmake: Use installed Qt's translations for packaging
This commit is contained in:
parent
665bbc2421
commit
be4fa061ee
30
macxconf.pri
30
macxconf.pri
@ -7,13 +7,31 @@ else {
|
||||
include(conf.pri)
|
||||
}
|
||||
|
||||
# Custom function
|
||||
# Return Qt translations files as list of paths
|
||||
# It will return .qm files of qt/qtbase that aren't stub files.
|
||||
defineReplace(qbt_get_qt_translations) {
|
||||
# The $$[] syntax queries qmake properties
|
||||
TMP_TRANSLATIONS = $$files($$[QT_INSTALL_TRANSLATIONS]/qt_??.qm)
|
||||
TMP_TRANSLATIONS += $$files($$[QT_INSTALL_TRANSLATIONS]/qt_??_??.qm)
|
||||
TMP_TRANSLATIONS += $$files($$[QT_INSTALL_TRANSLATIONS]/qtbase_??.qm)
|
||||
TMP_TRANSLATIONS += $$files($$[QT_INSTALL_TRANSLATIONS]/qtbase_??_??.qm)
|
||||
|
||||
# Consider files less than 10KB as stub translations
|
||||
for (TRANSLATION, TMP_TRANSLATIONS) {
|
||||
TRANSLATION_SIZE = $$system("stat -f%z $${TRANSLATION}", true, EXIT_STATUS)
|
||||
equals(EXIT_STATUS, 0):!lessThan(TRANSLATION_SIZE, 10240): FINAL_TRANSLATIONS += $${TRANSLATION}
|
||||
}
|
||||
|
||||
return($$FINAL_TRANSLATIONS)
|
||||
}
|
||||
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
|
||||
|
||||
DEFINES += _DARWIN_FEATURE_64_BIT_INODE
|
||||
|
||||
LIBS += -framework Carbon -framework IOKit -framework AppKit
|
||||
|
||||
QT_LANG_PATH = ../dist/qt-translations
|
||||
DIST_PATH = ../dist/mac
|
||||
|
||||
document_icon.path = Contents/Resources
|
||||
@ -25,15 +43,7 @@ qt_conf.files = $$DIST_PATH/qt.conf
|
||||
QMAKE_BUNDLE_DATA += qt_conf
|
||||
|
||||
qt_translations.path = Contents/translations
|
||||
qt_translations.files = $$files($$QT_LANG_PATH/qtbase_*.qm)
|
||||
qt_translations.files += \
|
||||
$$QT_LANG_PATH/qt_fa.qm \
|
||||
$$QT_LANG_PATH/qt_gl.qm \
|
||||
$$QT_LANG_PATH/qt_lt.qm \
|
||||
$$QT_LANG_PATH/qt_pt.qm \
|
||||
$$QT_LANG_PATH/qt_sl.qm \
|
||||
$$QT_LANG_PATH/qt_sv.qm \
|
||||
$$QT_LANG_PATH/qt_zh_CN.qm
|
||||
qt_translations.files = $$qbt_get_qt_translations()
|
||||
QMAKE_BUNDLE_DATA += qt_translations
|
||||
|
||||
ICON = $$DIST_PATH/qbittorrent_mac.icns
|
||||
|
Loading…
Reference in New Issue
Block a user