aboutsummaryrefslogtreecommitdiffstats
path: root/tools/update-tx
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-01-18 23:02:12 +0000
committerAnders Broman <a.broman58@gmail.com>2018-01-21 20:16:58 +0000
commit00a528f1231a819ca06eda45b3d59de9bd0221ac (patch)
treee7b7fa1eefc42c78a0e6d4ee2a6b0fc059523f5c /tools/update-tx
parent145e3a5dc3ad2c8191696fa4748b1f3d8352252c (diff)
Qt: Translate files in subdirectories.
Make sure we pass ui/qt/*/*.{cpp,h} to lupdate. Make update-tx a bash script and make sure it passes ShellCheck. Add a -n flag, which disables pushing back to Transifex. Change-Id: Ia7d6564bbdbf69285f1f9b88cde09e37da4f916c Reviewed-on: https://code.wireshark.org/review/25382 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/update-tx')
-rwxr-xr-xtools/update-tx24
1 files changed, 19 insertions, 5 deletions
diff --git a/tools/update-tx b/tools/update-tx
index a01e4c1ab3..460b005e88 100755
--- a/tools/update-tx
+++ b/tools/update-tx
@@ -1,11 +1,23 @@
-#!/bin/sh
+#!/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" ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+# All .cpp, .h, and .ui files under ui/qt plus wireshark-qt.cpp.
+LUPDATE_FILES=$(find ui/qt -name '*.cpp' -o -name '*.h' -o -name '*.ui')
+LUPDATE_FILES=($LUPDATE_FILES wireshark-qt.cpp)
+
# Add line numbers
for i in ui/qt/*.ts ; do
- lupdate -locations absolute ui/qt/*.h ui/qt/*.cpp wireshark-qt.cpp ui/qt/*.ui -ts $i
+ lupdate -locations absolute "${LUPDATE_FILES[@]}" -ts "$i"
done
# Get last translation for Transifex
@@ -13,15 +25,17 @@ tx pull -f
# Regenerate last translation for repo
for i in ui/qt/*.ts ; do
- lupdate -locations absolute ui/qt/*.h ui/qt/*.cpp wireshark-qt.cpp ui/qt/*.ui -ts $i
+ lupdate -locations absolute "${LUPDATE_FILES[@]}" -ts "$i"
done
# Push last change tranlastion on Transifex
-tx push -t -s
+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 ui/qt/*.h ui/qt/*.cpp wireshark-qt.cpp ui/qt/*.ui -ts $i
+ lupdate -locations none -no-ui-lines "${LUPDATE_FILES[@]}" -ts "$i"
done
#Add new commit with last translaation update