summaryrefslogtreecommitdiffstats
path: root/translations/split-qt-ts.pl
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2012-11-19 15:01:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-20 17:10:37 +0100
commitefadf302266bdeb8324f4673ce23480e67ee2996 (patch)
tree6695b24c1e456c088f1d70b17d43e4d19670c739 /translations/split-qt-ts.pl
parente03b20c05bb7492e95e35bc4007a669c96307909 (diff)
modularize translations
this includes a script to modularize the old qt_??.ts files. Change-Id: I0fff36be18f5a9764d3ab1d2ee73e53cac43b979 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'translations/split-qt-ts.pl')
-rwxr-xr-xtranslations/split-qt-ts.pl73
1 files changed, 73 insertions, 0 deletions
diff --git a/translations/split-qt-ts.pl b/translations/split-qt-ts.pl
new file mode 100755
index 0000000..a8e6563
--- /dev/null
+++ b/translations/split-qt-ts.pl
@@ -0,0 +1,73 @@
+#! /usr/bin/perl -w
+#############################################################################
+##
+## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+## Contact: http://www.qt-project.org/legal
+##
+## This file is part of the translations module of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and Digia. For licensing terms and
+## conditions see http://qt.digia.com/licensing. For further information
+## use the contact form at http://qt.digia.com/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 2.1 requirements
+## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## In addition, as a special exception, Digia gives you certain additional
+## rights. These rights are described in the Digia Qt LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3.0 as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU General Public License version 3.0 requirements will be
+## met: http://www.gnu.org/copyleft/gpl.html.
+##
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+
+use strict;
+
+my @catalogs = ( "qtbase", "qtscript", "qtquick1", "qtmultimedia", "qtxmlpatterns" );
+
+die "Usage: $0 <locale> [<builddir>]\n" if (@ARGV != 1 && @ARGV != 2);
+my $lang = $ARGV[0];
+my $lupdate = "lupdate -locations relative -no-ui-lines";
+$lupdate .= " -pro-out $ARGV[1]" if (@ARGV == 2);
+
+for my $cat (@catalogs) {
+ system("$lupdate ../../$cat/src/src.pro qt_$lang.ts -ts ${cat}_$lang.ts") and die;
+}
+# qtdeclarative is special: we import it, but it's not part of the meta catalog
+system("$lupdate ../../qtdeclarative/src/src.pro qt_$lang.ts -ts qtdeclarative_$lang.ts") and die;
+
+open META, "> qt_$lang.ts" or die;
+print META <<EOF ;
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="C">
+ <dependencies>
+EOF
+for my $cat (@catalogs) {
+ print META " <dependency catalog=\"${cat}_$lang\"/>\n";
+}
+print META <<EOF ;
+ </dependencies>
+</TS>
+EOF
+close META or die;