2016-05-06 21:57:38 +08:00
|
|
|
#!/bin/bash
|
2019-06-24 22:01:18 +08:00
|
|
|
|
|
|
|
# Copyright © 2016 Zetok Zalbavar <zetok@openmailbox.org>
|
|
|
|
# Copyright © 2019 by The qTox Project Contributors
|
2016-05-06 21:57:38 +08:00
|
|
|
#
|
2019-06-24 22:01:18 +08:00
|
|
|
# This file is part of qTox, a Qt-based graphical interface for Tox.
|
|
|
|
# qTox is libre software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2016-05-06 21:57:38 +08:00
|
|
|
#
|
2019-06-24 22:01:18 +08:00
|
|
|
# qTox is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2016-05-06 21:57:38 +08:00
|
|
|
#
|
2019-06-24 22:01:18 +08:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with qTox. If not, see <http://www.gnu.org/licenses/>
|
2016-05-06 21:57:38 +08:00
|
|
|
|
|
|
|
# Script for updating translation files. Should be ran after
|
|
|
|
# translatable strings are modified.
|
|
|
|
#
|
|
|
|
# Needed, since Weblate cannot do it automatically.
|
|
|
|
|
|
|
|
# Usage:
|
2016-11-05 17:33:49 +08:00
|
|
|
# ./tools/$script_name [ALL|translation file]
|
2016-05-06 21:57:38 +08:00
|
|
|
|
2016-09-19 02:08:18 +08:00
|
|
|
set -eu -o pipefail
|
|
|
|
|
2022-02-21 20:37:55 +08:00
|
|
|
readonly LUPDATE_CMD="lupdate src -no-obsolete -locations none"
|
2016-09-19 02:08:18 +08:00
|
|
|
|
|
|
|
if [[ "$@" = "ALL" ]]
|
|
|
|
then
|
|
|
|
for translation in translations/*.ts
|
|
|
|
do
|
2022-02-21 20:37:55 +08:00
|
|
|
$LUPDATE_CMD -ts "$translation"
|
2016-09-19 02:08:18 +08:00
|
|
|
done
|
2022-02-21 20:37:55 +08:00
|
|
|
$LUPDATE_CMD -pluralonly -ts translations/en.ts
|
2016-09-19 02:08:18 +08:00
|
|
|
else
|
2016-11-05 17:33:49 +08:00
|
|
|
$LUPDATE_CMD "$@"
|
2016-09-19 02:08:18 +08:00
|
|
|
fi
|