File: update-tx

package info (click to toggle)
wireshark 4.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 351,436 kB
  • sloc: ansic: 3,103,613; cpp: 129,736; xml: 100,978; python: 56,510; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 164; ruby: 113; objc: 91; tcl: 35
file content (71 lines) | stat: -rwxr-xr-x 1,700 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
#!/bin/bash
# Copyright 2015, Alexis La Goutte (See AUTHORS file)
#
# Resync translation between Wireshark's git repository and Transifex

# We keep translation files in the following locations:
# ui/qt/*.ts (Qt)
# ui/stratoshark/*.ts (Qt)
# packaging/debian/po/ (Gettext)

NO_PUSH="False"
while getopts "n" OPTCHAR ; do
    case $OPTCHAR in
        n) NO_PUSH="True" ;;
        *) printf "Unknown option: %s\\n" "$OPTARG"
    esac
done
shift $((OPTIND - 1))

TOP_LEVEL=$(git rev-parse --show-toplevel)
if ! cd "$TOP_LEVEL" ; then
    echo "Can't change to the top-level source directory."
    exit 1
fi

LUPDATE_INCLUDES=(-I .)
while read -r ; do
    LUPDATE_INCLUDES+=(-I "$REPLY")
done < <(find "$TOP_LEVEL/ui/qt" -type d)

# All .cpp, .h, and .ui files under ui/qt
LUPDATE_FILES=()
while read -r ; do
    LUPDATE_FILES+=("$REPLY")
done < <(find ui/qt -name '*.cpp' -o -name '*.h' -o -name '*.ui')

# Add line numbers
for i in ui/qt/*.ts ; do
    lupdate -locations absolute "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
done

# Get last translation for Transifex
tx pull -f

# Regenerate last translation for repo
for i in ui/qt/*.ts ; do
    lupdate -locations absolute "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
done

# Push last change tranlastion on Transifex
if [ "$NO_PUSH" != "True" ]; then
    tx push -t -s
fi

# Remove line numbers
for i in ui/qt/*.ts ; do
    lupdate -locations none -no-ui-lines "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
done

#
#  Editor modelines
#
#  Local Variables:
#  c-basic-offset: 4
#  tab-width: 8
#  indent-tabs-mode: nil
#  End:
#
#  ex: set shiftwidth=4 tabstop=8 expandtab:
#  :indentSize=4:tabSize=8:noTabs=true:
#