Thu, 23 Jan 2014 23:38:47 -0800
Merge release-2.x.y branch into main, with manual merges in
ChangeLog (easy)
Makefile.mingw (easy)
configure.ac (easy)
irc/msgs.c (not too bad)
And some Windows build files. We should make sure the pango used by 3.0.0
doesn't have the crash bug from CVE-2013-6486.
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
1 | #!/usr/bin/perl |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
2 | # |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
3 | # create_nsis_translations.pl |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
4 | # |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
5 | # Copyright (C) 2000-2009 Bruno Coudoin |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
6 | # |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
7 | # This program is free software; you can redistribute it and/or modify |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
8 | # it under the terms of the GNU General Public License as published by |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
9 | # the Free Software Foundation; either version 3 of the License, or |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
10 | # (at your option) any later version. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
11 | # |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
12 | # This program is distributed in the hope that it will be useful, |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
15 | # GNU General Public License for more details. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
16 | # |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
17 | # You should have received a copy of the GNU General Public License |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
18 | # along with this program; if not, see <http://www.gnu.org/licenses/>. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
19 | # |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
20 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
21 | use strict; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
22 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
23 | sub usage { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
24 | print 'create_nsis_translations.pl translations installer tmp_dir |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
25 | translations |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
26 | This is an input file that contains all the |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
27 | translated strings. If must be formated as a GNU/Linux |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
28 | desktop file and contains multiple strings entry. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
29 | For example you must have: |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
30 | toBe=To be or not to be |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
31 | toBe[fr]=Etre ou ne pas etre |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
32 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
33 | installer |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
34 | This is your nsis installer source file. You must include |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
35 | in it the marker @INSERT_TRANSLATIONS@ before you use any |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
36 | translation string. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
37 | After that you can use the variable $(toBe) in your file. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
38 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
39 | tmp_dir |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
40 | This is a directory in which temporary files needed for |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
41 | the translation system. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
42 | It will be created if non existant. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
43 | You can remove it once you have created your installer. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
44 | '; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
45 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
46 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
47 | my $translations; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
48 | if (! $ARGV[0] || ! -f $ARGV[0]) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
49 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
50 | usage(); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
51 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
52 | else |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
53 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
54 | $translations = $ARGV[0]; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
55 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
56 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
57 | shift; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
58 | my $installer; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
59 | if (! $ARGV[0] || ! -f $ARGV[0]) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
60 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
61 | usage(); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
62 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
63 | else |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
64 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
65 | $installer = $ARGV[0]; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
66 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
67 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
68 | shift; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
69 | my $tmp_dir; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
70 | if (! $ARGV[0] ) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
71 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
72 | usage(); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
73 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
74 | else |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
75 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
76 | $tmp_dir = $ARGV[0]; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
77 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
78 | if ( ! -d $tmp_dir ) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
79 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
80 | mkdir $tmp_dir or die "ERROR: '$tmp_dir' $!\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
81 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
82 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
83 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
84 | print "Processing translation file '$translations'\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
85 | print " NSIS source file '$installer'\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
86 | print " Working dir '$tmp_dir'\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
87 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
88 | # Commented out locales that are not available in nsis |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
89 | # Map value is ["NSISFilename", "Encoding", "LCID"] |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
90 | my %localeNames = ( |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
91 | "af" => ["Afrikaans", "WINDOWS-1252", "1078"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
92 | # "am" => ["Amharic", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
93 | "ar" => ["Arabic", "WINDOWS-1256", "1025"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
94 | "be" => ["Belarusian", "WINDOWS-1251", "1059"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
95 | "bg" => ["Bulgarian", "WINDOWS-1251", "1026"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
96 | "bs" => ["Bosnian", "WINDOWS-1250", "5146"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
97 | "br" => ["Breton", "WINDOWS-1252", "1150"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
98 | "ca" => ["Catalan", "WINDOWS-1252", "1027"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
99 | "cs" => ["Czech", "WINDOWS-1250", "1029"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
100 | "cy" => ["Welsh", "WINDOWS-1252", "1160"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
101 | "da" => ["Danish", "WINDOWS-1252", "1030"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
102 | "de" => ["German", "WINDOWS-1252", "1031"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
103 | # "dz" => ["Dzongkha", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
104 | "el" => ["Greek", "WINDOWS-1253", "1032"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
105 | "en" => ["English", "WINDOWS-1252", "1033"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
106 | "eo" => ["Esperanto", "WINDOWS-1252", "9998"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
107 | "es" => ["Spanish", "WINDOWS-1252", "1034"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
108 | "et" => ["Estonian", "WINDOWS-1257", "1061"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
109 | "eu" => ["Basque", "WINDOWS-1252", "1069"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
110 | "fa" => ["Farsi", "WINDOWS-1256", "1065"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
111 | "fi" => ["Finnish", "WINDOWS-1252", "1035"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
112 | "fr" => ["French", "WINDOWS-1252", "1036"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
113 | "ga" => ["Irish", "WINDOWS-1252", "2108"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
114 | "gl" => ["Galician", "WINDOWS-1252", "1110"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
115 | # "gu" => ["Gujarati", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
116 | "he" => ["Hebrew", "WINDOWS-1255", "1037"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
117 | # "hi" => ["Hindi", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
118 | "hr" => ["Croatian", "WINDOWS-1250", "1050"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
119 | "hu" => ["Hungarian", "WINDOWS-1250", "1038"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
120 | "id" => ["Indonesian", "WINDOWS-1252", "1057"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
121 | "is" => ["Icelandic", "WINDOWS-1252", "15"], #This should be 1039! |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
122 | "it" => ["Italian", "WINDOWS-1252", "1040"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
123 | "ja" => ["Japanese", "CP932", "1041"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
124 | # "ka" => ["Georgian", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
125 | "ko" => ["Korean", "CP949", "1042"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
126 | "ku" => ["Kurdish", "WINDOWS-1254", "9999"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
127 | "lb" => ["Luxembourgish", "WINDOWS-1252", "4103"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
128 | "lt" => ["Lithuanian", "WINDOWS-1257", "1063"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
129 | "lv" => ["Latvian", "WINDOWS-1257", "1062"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
130 | "mk" => ["Macedonian", "WINDOWS-1251", "1071"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
131 | # "ml" => ["Malayalam", "UTF-8"], |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
132 | # "mr" => ["Marathi", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
133 | "mn" => ["Mongolian", "WINDOWS-1251", "1104"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
134 | "ms" => ["Malay", "WINDOWS-1252", "1086"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
135 | "nb" => ["Norwegian", "WINDOWS-1252", "1044"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
136 | # "ne" => ["Nepal", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
137 | "nl" => ["Dutch", "WINDOWS-1252", "1043"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
138 | "nn" => ["NorwegianNynorsk", "WINDOWS-1252", "2068"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
139 | # "oc" => ["Occitan", "WINDOWS-1252"], |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
140 | # "pa" => ["Punjabi", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
141 | "pl" => ["Polish", "WINDOWS-1250", "1045"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
142 | "pt" => ["Portuguese", "WINDOWS-1252", "2070"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
143 | "pt_BR" => ["PortugueseBR", "WINDOWS-1252", "1046"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
144 | "ro" => ["Romanian", "WINDOWS-1250", "1048"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
145 | "ru" => ["Russian", "WINDOWS-1251", "1049"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
146 | # "rw" => ["Kinyarwanda", "UTF-8"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
147 | "sk" => ["Slovak", "WINDOWS-1250", "1051"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
148 | "sl" => ["Slovenian", "WINDOWS-1250", "1060"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
149 | # "so" => ["Somali", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
150 | "sq" => ["Albanian", "WINDOWS-1252", "1052"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
151 | "sr" => ["Serbian", "WINDOWS-1251", "3098"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
152 | "sr\@latin" => ["SerbianLatin", "WINDOWS-1250", "2074"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
153 | "sv" => ["Swedish", "WINDOWS-1252", "1053"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
154 | # "ta" => ["Tamil", "UTF-8"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
155 | "th" => ["Thai", "WINDOWS-874", "1054"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
156 | "tr" => ["Turkish", "WINDOWS-1254", "1055"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
157 | "uk" => ["Ukrainian", "WINDOWS-1251", "1058"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
158 | "uz" => ["Uzbek", "WINDOWS-1252", "1091"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
159 | # "ur" => ["Urdu", "UTF-8"], |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
160 | # "vi" => ["Vietnamese", "WINDOWS-1258"], |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
161 | # "wa" => ["Walloon", "WINDOWS-1252"], |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
162 | "zh_CN" => ["SimpChinese", "WINDOWS-936", "2052"], |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
163 | "zh_TW" => ["TradChinese", "CP950", "1028"], |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
164 | ); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
165 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
166 | my @localeKeys = keys(%localeNames); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
167 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
168 | # Create the holder for the results |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
169 | # %result{"locale"}{"stringname"} = result line |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
170 | print "Parsing nsis_translations.desktop\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
171 | my %result; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
172 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
173 | # Create a hash of the keys to translate |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
174 | open (MYFILE, $translations); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
175 | while (<MYFILE>) { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
176 | chomp $_; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
177 | if ($_ =~ /Encoding=UTF-8/) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
178 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
179 | next; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
180 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
181 | elsif ($_ =~ /^(\w+)=(.*)/) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
182 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
183 | my $line = "!define $1 \"$2\"\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
184 | $result{"en"}{"$1"} = $line; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
185 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
186 | elsif ($_ =~ /^(\w+)\[(\w+)\]=(.*)/) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
187 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
188 | my $line = "!define $1 \"$3\"\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
189 | $result{"$2"}{"$1"} = $line; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
190 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
191 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
192 | close (MYFILE); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
193 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
194 | # Lets insert the default languages |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
195 | # in the installer file which means replacing: |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
196 | # @INSERTMACRO_MUI_LANGUAGE@ |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
197 | # By the list of locales: |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
198 | # !insertmacro MUI_LANGUAGE "French" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
199 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
200 | my $muiLanguages; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
201 | $muiLanguages = ' |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
202 | ;; English goes first because its the default. The rest are |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
203 | ;; in alphabetical order (at least the strings actually displayed |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
204 | ;; will be). |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
205 | !insertmacro MUI_LANGUAGE "English" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
206 | '; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
207 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
208 | # The specific GCompris translation for the installer |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
209 | # replacing: |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
210 | # @GCOMPRIS_MACRO_INCLUDE_LANGFILE@ |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
211 | # By the list of locales: |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
212 | # !insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "ALBANIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\albanian.nsh" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
213 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
214 | my $gcomprisLanguages; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
215 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
216 | $gcomprisLanguages .= ' |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
217 | ;-------------------------------- |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
218 | ;Translations |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
219 | !define GCOMPRIS_DEFAULT_LANGFILE "${GCOMPRIS_NSIS_INCLUDE_PATH}\\translations\\en.nsh" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
220 | ;; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
221 | ;; Windows GCompris NSIS installer language macros |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
222 | ;; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
223 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
224 | !macro GCOMPRIS_MACRO_DEFAULT_STRING LABEL VALUE |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
225 | !ifndef "${LABEL}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
226 | !define "${LABEL}" "${VALUE}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
227 | !ifdef INSERT_DEFAULT |
|
30283
4eeb03f317d6
Further updates to the create_nsis_translations.pl script.
Daniel Atallah <datallah@pidgin.im>
parents:
30279
diff
changeset
|
228 | !warning "${LANG} lang file missing ${LABEL}, using default..." |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
229 | !endif |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
230 | !endif |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
231 | !macroend |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
232 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
233 | !macro GCOMPRIS_MACRO_LANGSTRING_INSERT LABEL LANG |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
234 | LangString "${LABEL}" "${LANG_${LANG}}" "${${LABEL}}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
235 | !undef "${LABEL}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
236 | !macroend |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
237 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
238 | !macro GCOMPRIS_MACRO_LANGUAGEFILE_BEGIN LANG |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
239 | !define CUR_LANG "${LANG}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
240 | !macroend |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
241 | '; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
242 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
243 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
244 | # GCOMPRIS_MACRO_LANGUAGEFILE_END |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
245 | $gcomprisLanguages .= ' |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
246 | !macro GCOMPRIS_MACRO_LANGUAGEFILE_END |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
247 | !define INSERT_DEFAULT |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
248 | !include "${GCOMPRIS_DEFAULT_LANGFILE}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
249 | !undef INSERT_DEFAULT |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
250 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
251 | ; String labels should match those from the default language file. |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
252 | '; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
253 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
254 | my $text_en = $result{"en"}; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
255 | foreach my $keyEn (keys(%$text_en)) { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
256 | $gcomprisLanguages .= " !insertmacro GCOMPRIS_MACRO_LANGSTRING_INSERT $keyEn \${CUR_LANG}"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
257 | $gcomprisLanguages .= "\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
258 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
259 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
260 | $gcomprisLanguages .= ' |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
261 | !undef CUR_LANG |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
262 | !macroend |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
263 | '; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
264 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
265 | $gcomprisLanguages .= ' |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
266 | !macro GCOMPRIS_MACRO_INCLUDE_LANGFILE LANG FILE |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
267 | !insertmacro GCOMPRIS_MACRO_LANGUAGEFILE_BEGIN "${LANG}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
268 | !include "${FILE}" |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
269 | !insertmacro GCOMPRIS_MACRO_LANGUAGEFILE_END |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
270 | !macroend |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
271 | '; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
272 | |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
273 | # |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
274 | # Create each nsh translation file |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
275 | # |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
276 | |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
277 | print "Creating the nsh default file\n"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
278 | open (DESC, ">$tmp_dir/en.nsh"); |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
279 | print DESC ";; Auto generated file by create_nsis_translations.pl\n"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
280 | foreach my $keyEn (keys(%$text_en)) { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
281 | my $line = $result{'en'}{$keyEn}; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
282 | $line =~ s/!define /!insertmacro GCOMPRIS_MACRO_DEFAULT_STRING /; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
283 | print DESC $line; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
284 | } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
285 | close DESC; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
286 | |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
287 | $gcomprisLanguages .= " !insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE". |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
288 | " \"ENGLISH\"". |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
289 | " \"\${GCOMPRIS_NSIS_INCLUDE_PATH}\\translations\\en.nsh\"\n"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
290 | |
|
30285
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
291 | my $selectTranslationFunction = ' |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
292 | !macro SELECT_TRANSLATION_SECTION LANG_NAME LANG_CODE |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
293 | StrCmp "$LANGUAGE" "${LANG_${LANG_NAME}}" 0 end_${LANG_CODE} |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
294 | !insertmacro SelectSection ${SecLang_${LANG_CODE}} |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
295 | Goto done |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
296 | end_${LANG_CODE}: |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
297 | !macroend |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
298 | ; Convert the current $LANGUAGE to a language code that we can use for translation mo selection |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
299 | ; If there\'s a better way to do this, I\'d love to know it |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
300 | !macro SELECT_TRANSLATION_FUNCTION |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
301 | '; |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
302 | |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
303 | # |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
304 | # Two pass are needed: |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
305 | # - create the utf8 file |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
306 | # - transform it to the proper windows locale |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
307 | # |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
308 | print "Creating the nsh locale files\n"; |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
309 | foreach my $lang (@localeKeys) { |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
310 | if ( $lang eq "en" ) { next; } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
311 | open (DESC, ">$tmp_dir/$lang.nsh.utf8"); |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
312 | print DESC ";; Auto generated file by create_nsis_translations.pl\n"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
313 | print DESC ";; Code Page: $localeNames{$lang}[1]\n"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
314 | |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
315 | my $text_locale = $result{"$lang"}; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
316 | my $total_key_count = 0; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
317 | my $found_key_count = 0; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
318 | foreach my $keyEn (keys(%$text_en)) { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
319 | my $found = 0; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
320 | $total_key_count++; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
321 | foreach my $keyLocale (keys(%$text_locale)) { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
322 | # Fine, we found a translation |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
323 | if ( $keyLocale eq $keyEn ) |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
324 | { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
325 | print DESC "$result{$lang}{$keyLocale}"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
326 | $found = 1; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
327 | $found_key_count++; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
328 | last; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
329 | } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
330 | } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
331 | # English keys are the reference. |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
332 | # If not found they are inserted |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
333 | #if ( ! $found ) |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
334 | #{ |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
335 | # print DESC "$result{'en'}{$keyEn}"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
336 | #} |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
337 | } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
338 | close DESC; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
339 | |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
340 | # If we have at least 50% of the keys found, include the language |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
341 | if (($found_key_count * 1.0 / $total_key_count) >= 0.5) { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
342 | $muiLanguages .= " !insertmacro MUI_LANGUAGE \"$localeNames{$lang}[0]\"\n"; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
343 | $gcomprisLanguages .= " !insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE". |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
344 | " \"". uc($localeNames{$lang}[0]) . "\"". |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
345 | " \"\${GCOMPRIS_NSIS_INCLUDE_PATH}\\translations\\$lang.nsh\"\n"; |
|
30285
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
346 | $selectTranslationFunction .= " !insertmacro SELECT_TRANSLATION_SECTION". |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
347 | " \"" . uc($localeNames{$lang}[0]) . "\" \"$lang\"\n"; |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
348 | } else { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
349 | print "Ignoring language $lang because it is less than 50% translated ($found_key_count of $total_key_count).\n"; |
|
30285
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
350 | next; |
|
30284
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
351 | } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
352 | |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
353 | |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
354 | # iconv conversion |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
355 | system("iconv -f UTF-8 -t $localeNames{$lang}[1] $tmp_dir/$lang.nsh.utf8 > $tmp_dir/$lang.nsh"); |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
356 | if ($? ne 0) |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
357 | { |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
358 | die("ERROR: Failed to run: iconv -f UTF-8 -t $localeNames{$lang}[1] $lang.nsh.utf8 > $lang.nsh\n"); |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
359 | } |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
360 | #`rm $tmp_dir/$lang.nsh.utf8`; |
|
f65517a4cb79
More improvements to create_nsis_translations.pl - I have more to do, but I'm
Daniel Atallah <datallah@pidgin.im>
parents:
30283
diff
changeset
|
361 | |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
362 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
363 | |
|
30285
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
364 | $selectTranslationFunction .= ' |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
365 | done: |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
366 | !macroend |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
367 | '; |
|
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
368 | |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
369 | # We have all the data, let's replace it |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
370 | my $gcomprisInstaller; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
371 | open (MYFILE, $installer); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
372 | while (<MYFILE>) { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
373 | if ($_ =~ /\@INSERT_TRANSLATIONS\@/) |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
374 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
375 | print "Processing \@INSERT_TRANSLATIONS\@\n"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
376 | $gcomprisInstaller .= $muiLanguages; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
377 | $gcomprisInstaller .= $gcomprisLanguages; |
|
30285
33c8197dc6b6
Final piece of getting the installer translations integrated with the regular
Daniel Atallah <datallah@pidgin.im>
parents:
30284
diff
changeset
|
378 | $gcomprisInstaller .= $selectTranslationFunction; |
|
30277
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
379 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
380 | else |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
381 | { |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
382 | $gcomprisInstaller .= "$_"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
383 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
384 | } |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
385 | close (MYFILE); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
386 | |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
387 | # Rewrite the file with the replaced data |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
388 | open (MYFILE, ">$installer"); |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
389 | print MYFILE "$gcomprisInstaller"; |
|
0cd5960b2939
Add unmodified create_nsis_translations.pl script from the gcompris project.
Daniel Atallah <datallah@pidgin.im>
parents:
diff
changeset
|
390 | close (MYFILE); |