source: trunk/translations/translations.pri@ 867

Last change on this file since 867 was 846, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 2.5 KB
Line 
1qtPrepareTool(LCONVERT, lconvert)
2qtPrepareTool(LUPDATE, lupdate)
3LUPDATE += -locations relative -no-ui-lines
4
5TS_TARGETS =
6
7# meta target name, target name, lupdate base options, files
8defineTest(addTsTarget) {
9 cv = $${2}.commands
10 $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
11 export($$cv)
12 dv = $${1}.depends
13 $$dv += $$2
14 export($$dv)
15 TS_TARGETS += $$1 $$2
16 export(TS_TARGETS)
17}
18
19# target basename, lupdate base options
20defineTest(addTsTargets) {
21 files = $$files($$PWD/$${1}_??.ts) $$files($$PWD/$${1}_??_??.ts)
22 for(file, files) {
23 lang = $$replace(file, .*_((.._)?..)\\.ts$, \\1)
24 addTsTarget(ts-$$lang, ts-$$1-$$lang, $$2, $$file)
25 }
26 addTsTarget(ts-untranslated, ts-$$1-untranslated, $$2, $$PWD/$${1}_untranslated.ts)
27 addTsTarget(ts-all, ts-$$1-all, $$2, $$PWD/$${1}_untranslated.ts $$files)
28}
29
30addTsTargets(qt, -I../include -I../include/Qt \
31 3rdparty/phonon \
32 3rdparty/webkit \
33 activeqt \
34 corelib \
35 declarative \
36 gui \
37 multimedia \
38 network \
39 opengl \
40 plugins \
41 qt3support \
42 script \
43 scripttools \
44 sql \
45 svg \
46 xml \
47 xmlpatterns \
48)
49addTsTargets(designer, ../tools/designer/designer.pro)
50addTsTargets(linguist, ../tools/linguist/linguist.pro)
51addTsTargets(assistant, ../tools/assistant/tools/tools.pro)
52addTsTargets(qt_help, ../tools/assistant/lib/lib.pro)
53addTsTargets(qtconfig, ../tools/qtconfig/qtconfig.pro)
54addTsTargets(qvfb, ../tools/qvfb/qvfb.pro)
55
56check-ts.commands = (cd $$PWD && perl check-ts.pl)
57check-ts.depends = ts-all
58
59isEqual(QMAKE_DIR_SEP, /) {
60 commit-ts.commands = \
61 cd $$PWD/..; \
62 for f in `git diff-files --name-only translations/*_??.ts`; do \
63 $$LCONVERT -locations none -i \$\$f -o \$\$f; \
64 done; \
65 git add translations/*_??.ts && git commit
66} else {
67 wd = $$replace(PWD, /, \\)\\..
68 commit-ts.commands = \
69 cd $$wd && \
70 for /f usebackq %%f in (`git diff-files --name-only translations/*_??.ts`) do \
71 $$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
72 cd $$wd && git add translations/*_??.ts && git commit
73}
74
75ts.commands = \
76 @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
77 echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead. To add a language,\" && \
78 echo \"use \'untranslated\' for <lang>, rename the files and re-run \'qmake\'.\"
79
80QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts commit-ts check-ts
Note: See TracBrowser for help on using the repository browser.