dcerpc-nt: add UNION_ALIGN_TO... helpers
[wireshark-sm.git] / tools / update-tx
blob386980f2d969b908e514a47fa67ae98e6a7a954d
1 #!/bin/bash
2 # Copyright 2015, Alexis La Goutte (See AUTHORS file)
4 # Resync translation between Wireshark's git repository and Transifex
6 # We keep translation files in the following locations:
7 # ui/qt/*.ts (Qt)
8 # ui/stratoshark/*.ts (Qt)
9 # packaging/debian/po/ (Gettext)
11 NO_PUSH="False"
12 while getopts "n" OPTCHAR ; do
13 case $OPTCHAR in
14 n) NO_PUSH="True" ;;
15 *) printf "Unknown option: %s\\n" "$OPTARG"
16 esac
17 done
18 shift $((OPTIND - 1))
20 TOP_LEVEL=$(git rev-parse --show-toplevel)
21 if ! cd "$TOP_LEVEL" ; then
22 echo "Can't change to the top-level source directory."
23 exit 1
26 LUPDATE_INCLUDES=(-I .)
27 while read -r ; do
28 LUPDATE_INCLUDES+=(-I "$REPLY")
29 done < <(find "$TOP_LEVEL/ui/qt" -type d)
31 # All .cpp, .h, and .ui files under ui/qt
32 LUPDATE_FILES=()
33 while read -r ; do
34 LUPDATE_FILES+=("$REPLY")
35 done < <(find ui/qt -name '*.cpp' -o -name '*.h' -o -name '*.ui')
37 # Add line numbers
38 for i in ui/qt/*.ts ; do
39 lupdate -locations absolute "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
40 done
42 # Get last translation for Transifex
43 tx pull -f
45 # Regenerate last translation for repo
46 for i in ui/qt/*.ts ; do
47 lupdate -locations absolute "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
48 done
50 # Push last change tranlastion on Transifex
51 if [ "$NO_PUSH" != "True" ]; then
52 tx push -t -s
55 # Remove line numbers
56 for i in ui/qt/*.ts ; do
57 lupdate -locations none -no-ui-lines "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
58 done
61 # Editor modelines
63 # Local Variables:
64 # c-basic-offset: 4
65 # tab-width: 8
66 # indent-tabs-mode: nil
67 # End:
69 # ex: set shiftwidth=4 tabstop=8 expandtab:
70 # :indentSize=4:tabSize=8:noTabs=true: