aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/comtqci18ndemo/comtqci18ndemo.pro
blob: 9528cbc24961d34666beb6f6aa7dd6ed87d74628 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
TEMPLATE = lib
TARGET  = comtqci18ndemoplugin
QT += qml quick
CONFIG += qt plugin c++11

uri = com.theqtcompany.comtqci18ndemo
load(qmlplugin)

SOURCES += \
    plugin.cpp \
    comtqci18ndemo.cpp \

HEADERS += \
    comtqci18ndemo.h \

# var, prepend, append
defineReplace(prependAll) {
    for(a,$$1):result += $$2$${a}$$3
    return($$result)
}

qmlAppPath = $$PWD/../../apps/com.theqtcompany.i18ndemo
# See qml files to scan while running lupdate/lrelease
lupdate_only {
    SOURCES += $$files($$shell_quote($$shell_path($${qmlAppPath}/))*.qml, true)
}

target.path = $$installPath

supportedLocales = \
    ar_AR \
    de_DE \
    en_GB \
    fi_FI \
    fr_FR \
    ja_JP \
    ko_KR \
    ru_RU \
    zh_CN \
    zh_TW

TRANSLATIONS = $$prependAll(supportedLocales, $$qmlAppPath/translations/i18napp_, .ts)

qtPrepareTool(LUPDATE, lupdate)
qtPrepareTool(LRELEASE, lrelease)

ts.commands = $$LUPDATE $$shell_quote($$_PRO_FILE_)
QMAKE_EXTRA_TARGETS += ts

qm.input = TRANSLATIONS
qm.output = $$shadowed($$qmlAppPath/translations)/${QMAKE_FILE_BASE}.qm
qm.variable_out = PRE_TARGETDEPS
qm.commands = $${LRELEASE} -idbased ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
qm.name = LRELEASE ${QMAKE_FILE_IN}
qm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += qm

qmfiles.files = $$prependAll(supportedLocales, $$shadowed($$qmlAppPath/translations)/i18napp_, .qm)
qmfiles.path = $$INSTALL_PREFIX/neptune-ui/apps/com.theqtcompany.i18ndemo/translations
qmfiles.CONFIG += no_check_exist

INSTALLS += qmfiles