diff --git a/update-translations.py b/update-translations.py index 38f9cb47e00d520356743a998d3fdfd36ae20e14..3e2931b5de5233b23515aa04e1056d64eb05fd02 100755 --- a/update-translations.py +++ b/update-translations.py @@ -1,13 +1,43 @@ #!/usr/bin/python +## +## Copyright (C) 2016-2017 Savoir-faire Linux Inc. +## +## Author: Edric Milaret <edric.ladent-milaret@savoirfairelinux.com> +## Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> +## +## This program is free 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. +## +## This program 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. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +## + import os import shutil -print ("Pulling translations") +print("== Updating from sources") +if os.system("lupdate RingWinClient.pro -no-obsolete"): + print("trying with 'lupdate-qt5'") + os.system("lupdate-qt5 RingWinClient.pro -no-obsolete") +else: + raise RuntimeError("unable to find any suitable lupdate Qt tool on this system. Stopping") + +print("== Pushing sources") +os.system("tx push -s") -os.system("tx pull -af --minimum-perc=30") +print("== Pulling translations") +os.system("tx pull -af --minimum-perc=1") -print ("Updating .pro file") +print("Updating .pro file") translationFiles = [] @@ -30,8 +60,4 @@ source.close() destination.close() os.remove(proFile + "~") -print ("Updating translations") - -os.system("lupdate RingWinClient.pro") - -print ("All done you can commit now") +print("== All done you can commit now")