| 1 |
# i18n generation & installation |
| 2 |
|
| 3 |
QM_FILES_INSTALL_PATH = $${DATA_INSTALL_PATH}/lang |
| 4 |
|
| 5 |
TRANSLATIONS += \ |
| 6 |
$$PWD/bamboo_tracker_fr.ts \ |
| 7 |
$$PWD/bamboo_tracker_ja.ts \ |
| 8 |
$$PWD/bamboo_tracker_pl.ts \ |
| 9 |
$$PWD/bamboo_tracker_es.ts \ |
| 10 |
|
| 11 |
equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12) { |
| 12 |
message(Using a workaround for missing 'lrelease' option in Qt <5.12...) |
| 13 |
|
| 14 |
for(tsfile, TRANSLATIONS) { |
| 15 |
qmfile = $$tsfile |
| 16 |
qmfile ~= s/.ts$/.qm/ |
| 17 |
qmfile ~= s,/lang/,/.qm/, |
| 18 |
|
| 19 |
win32:$${qmfile}.commands = mkdir $$PWD/../.qm; |
| 20 |
else:$${qmfile}.commands = test -d $$PWD/../.qm/ || mkdir -p $$PWD/../.qm/; |
| 21 |
$${qmfile}.commands += lrelease -qm $$qmfile $$tsfile |
| 22 |
$${qmfile}.depends = $${tsfile} |
| 23 |
|
| 24 |
PRE_TARGETDEPS += $${qmfile} |
| 25 |
QMAKE_EXTRA_TARGETS += $${qmfile} |
| 26 |
|
| 27 |
translations_target = translations_$$basename(qmfile) |
| 28 |
$${translations_target}.depends = $$qmfile |
| 29 |
$${translations_target}.CONFIG = no_check_exist |
| 30 |
$${translations_target}.files = $$qmfile |
| 31 |
$${translations_target}.path = $$QM_FILES_INSTALL_PATH |
| 32 |
|
| 33 |
INSTALLS += $${translations_target} |
| 34 |
} |
| 35 |
} |
| 36 |
else { |
| 37 |
!versionAtLeast(QT_VERSION, 5.14.2) { |
| 38 |
message(Using a workaround for 'qm_files' target missing its install phase due to checking for the translations too early...) |
| 39 |
qm_files.CONFIG = no_check_exist |
| 40 |
} |
| 41 |
CONFIG += lrelease |
| 42 |
} |