summaryrefslogtreecommitdiffstats
path: root/tools/update-tx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /tools/update-tx
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/update-tx')
-rwxr-xr-xtools/update-tx72
1 files changed, 72 insertions, 0 deletions
diff --git a/tools/update-tx b/tools/update-tx
new file mode 100755
index 0000000..b91bcfa
--- /dev/null
+++ b/tools/update-tx
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Copyright 2015, Alexis La Goutte (See AUTHORS file)
+#
+# Resync translation between Gerrit repo and Transifex
+
+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
+
+#Add new commit with last translation update
+#git commit -a -m "TX: Update Translations (sync)"
+
+#Push update translation on Gerrit
+#git push origin HEAD:refs/for/master/tx
+
+#
+# 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:
+#