![Gerald Combs](/assets/img/avatar_default.png)
Fix various warnings with the following changes: Pass a list of include directories to lupdate. Fixes: ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree and similar warnings. Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes: ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data Add Q_OBJECT to the class definition. Fixes: ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro The following warnings were not fixed. This might require moving IOGraph to its own file: ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog
73 lines
1.7 KiB
Bash
Executable file
73 lines
1.7 KiB
Bash
Executable file
#!/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:
|
|
#
|