author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:40:16 +0200 | |
branch | RCL_3 |
changeset 4 | 3b1da2848fc7 |
parent 0 | 1918ee327afb |
child 30 | 5dc02b23752f |
permissions | -rw-r--r-- |
0 | 1 |
#!/usr/bin/env perl |
2 |
############################################################################# |
|
3 |
## |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
4 |
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 5 |
## All rights reserved. |
6 |
## Contact: Nokia Corporation (qt-info@nokia.com) |
|
7 |
## |
|
8 |
## This file is part of the test suite of the Qt Toolkit. |
|
9 |
## |
|
10 |
## $QT_BEGIN_LICENSE:LGPL$ |
|
11 |
## No Commercial Usage |
|
12 |
## This file contains pre-release code and may not be distributed. |
|
13 |
## You may use this file in accordance with the terms and conditions |
|
14 |
## contained in the Technology Preview License Agreement accompanying |
|
15 |
## this package. |
|
16 |
## |
|
17 |
## GNU Lesser General Public License Usage |
|
18 |
## Alternatively, this file may be used under the terms of the GNU Lesser |
|
19 |
## General Public License version 2.1 as published by the Free Software |
|
20 |
## Foundation and appearing in the file LICENSE.LGPL included in the |
|
21 |
## packaging of this file. Please review the following information to |
|
22 |
## ensure the GNU Lesser General Public License version 2.1 requirements |
|
23 |
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
24 |
## |
|
25 |
## In addition, as a special exception, Nokia gives you certain additional |
|
26 |
## rights. These rights are described in the Nokia Qt LGPL Exception |
|
27 |
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
28 |
## |
|
29 |
## If you have questions regarding the use of this file, please contact |
|
30 |
## Nokia at qt-info@nokia.com. |
|
31 |
## |
|
32 |
## |
|
33 |
## |
|
34 |
## |
|
35 |
## |
|
36 |
## |
|
37 |
## |
|
38 |
## |
|
39 |
## $QT_END_LICENSE$ |
|
40 |
## |
|
41 |
############################################################################# |
|
42 |
||
43 |
sub makeit2($$$) |
|
44 |
{ |
|
45 |
for (my $i = 0; $i < (1 << $_[0]); $i++) { |
|
46 |
print OUTFILE "\n"; |
|
47 |
print OUTFILE "$_[2]\n" unless $3 eq ""; |
|
48 |
print OUTFILE "msgid \"singular $_[1] $i\"\n"; |
|
49 |
print OUTFILE "msgid_plural \"plural $_[1] $i\"\n"; |
|
50 |
for (my $j = 0; $j < $_[0]; $j++) { |
|
51 |
my $tr; |
|
52 |
if (($i & (1 << $j)) == 0) { |
|
53 |
$tr = "translated $_[1] $i $j"; |
|
54 |
} |
|
55 |
print OUTFILE "msgstr[$j] \"$tr\"\n"; |
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
||
60 |
sub makeit($$) |
|
61 |
{ |
|
62 |
open OUTFILE, ">${OUTDIR}plural-$_[0].po" || die "cannot write file in $OUTDIR"; |
|
63 |
print OUTFILE <<EOF; |
|
64 |
msgid "" |
|
65 |
msgstr "" |
|
66 |
"X-FooBar: yup\\n" |
|
67 |
"X-Language: $_[1]\\n" |
|
68 |
EOF |
|
69 |
makeit2($_[0], "one", ""); |
|
70 |
makeit2($_[0], "two", "#, fuzzy |
|
71 |
#| msgid \"old untranslated one\""); |
|
72 |
makeit2($_[0], "three", "#, fuzzy |
|
73 |
#| msgid \"old untranslated two\" |
|
74 |
#| msgid_plural \"old untranslated plural two\""); |
|
75 |
makeit2($_[0], "four", "#, fuzzy |
|
76 |
#| msgid_plural \"old untranslated only plural three\""); |
|
77 |
} |
|
78 |
||
79 |
$OUTDIR = $ARGV[0]; |
|
80 |
makeit(1, "zh_CN"); |
|
81 |
makeit(2, "de_DE"); |
|
82 |
makeit(3, "pl_PL"); |