Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/translations/translations.pri

    r769 r846  
    1 defineReplace(prependAll) {
    2     prepend = $$1
    3     arglist = $$2
    4     append  = $$3
    5     for(a,arglist) {
    6       result += $${prepend}$${a}$${append}
    7     }
    8     return ($$result)
    9 }
    10 
     1qtPrepareTool(LCONVERT, lconvert)
    112qtPrepareTool(LUPDATE, lupdate)
    123LUPDATE += -locations relative -no-ui-lines
    134
    14 ###### Qt Libraries
     5TS_TARGETS =
    156
    16 QT_TS        = ar cs da de es fr he ja_JP pl pt ru sk sl sv uk zh_CN zh_TW
     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}
    1718
    18 ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
    19                                 -I../include -I../include/Qt \
    20                                     3rdparty/phonon \
    21                                     3rdparty/webkit \
    22                                     activeqt \
    23                                     corelib \
    24                                     gui \
    25                                     multimedia \
    26                                     network \
    27                                     opengl \
    28                                     plugins \
    29                                     qt3support \
    30                                     script \
    31                                     scripttools \
    32                                     sql \
    33                                     svg \
    34                                     xml \
    35                                     xmlpatterns \
    36                                 -ts $$prependAll($$QT_SOURCE_TREE/translations/qt_,$$QT_TS,.ts))
    37 ts-qt.depends = sub-tools
     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}
    3829
    39 ###### Designer
     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)
    4055
    41 ts-designer.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
    42                                     ../tools/designer/translations/translations.pro)
    43 ts-designer.depends = sub-tools
     56check-ts.commands = (cd $$PWD && perl check-ts.pl)
     57check-ts.depends = ts-all
    4458
    45 ###### Linguist
     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}
    4674
    47 ts-linguist.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
    48                                     ../tools/linguist/linguist/linguist.pro)
    49 ts-linguist.depends = sub-tools
     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\'.\"
    5079
    51 ###### Assistant
    52 
    53 ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
    54                                     ../tools/assistant/translations/translations.pro \
    55                                     && $$LUPDATE \
    56                                     ../tools/assistant/translations/qt_help.pro \
    57                                     && $$LUPDATE \
    58                                     ../tools/assistant/translations/translations_adp.pro)
    59 ts-assistant.depends = sub-tools
    60 
    61 ###### Qtconfig
    62 
    63 ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
    64                                     ../tools/qtconfig/translations/translations.pro)
    65 ts-qtconfig.depends = sub-tools
    66 
    67 ###### Qvfp
    68 
    69 ts-qvfb.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
    70                                     ../tools/qvfb/translations/translations.pro)
    71 ts-qvfb.depends = sub-tools
    72 
    73 ###### Overall Rules
    74 
    75 ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb
    76 
    77 QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb \
    78                        ts
     80QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts commit-ts check-ts
Note: See TracChangeset for help on using the changeset viewer.