2 # Copyright 2015, Alexis La Goutte (See AUTHORS file)
4 # Resync translation between Gerrit repo and Transifex
7 while getopts "n" OPTCHAR
; do
10 *) printf "Unknown option: %s\\n" "$OPTARG"
15 TOP_LEVEL
=$
(git rev-parse
--show-toplevel)
16 if ! cd "$TOP_LEVEL" ; then
17 echo "Can't change to the top-level source directory."
21 LUPDATE_INCLUDES
=(-I .
)
23 LUPDATE_INCLUDES
+=(-I "$REPLY")
24 done < <(find "$TOP_LEVEL/ui/qt" -type d
)
26 # All .cpp, .h, and .ui files under ui/qt
29 LUPDATE_FILES
+=("$REPLY")
30 done < <(find ui
/qt
-name '*.cpp' -o -name '*.h' -o -name '*.ui')
33 for i
in ui
/qt
/*.ts
; do
34 lupdate
-locations absolute
"${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
37 # Get last translation for Transifex
40 # Regenerate last translation for repo
41 for i
in ui
/qt
/*.ts
; do
42 lupdate
-locations absolute
"${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
45 # Push last change tranlastion on Transifex
46 if [ "$NO_PUSH" != "True" ]; then
51 for i
in ui
/qt
/*.ts
; do
52 lupdate
-locations none
-no-ui-lines "${LUPDATE_INCLUDES[@]}" "${LUPDATE_FILES[@]}" -ts "$i"
55 #Add new commit with last translation update
56 #git commit -a -m "TX: Update Translations (sync)"
58 #Push update translation on Gerrit
59 #git push origin HEAD:refs/for/master/tx
67 # indent-tabs-mode: nil
70 # ex: set shiftwidth=4 tabstop=8 expandtab:
71 # :indentSize=4:tabSize=8:noTabs=true: