Andrew Lewman commited on 2010-10-03 02:58:26
Zeige 5 geänderte Dateien mit 58 Einfügungen und 51 Löschungen.
... | ... |
@@ -19,8 +19,8 @@ |
19 | 19 |
# FIXME: these are the same |
20 | 20 |
export TORSVNSTABLE=/home/phobos/onionrouter/onionrouter/tor/ |
21 | 21 |
export TORGIT=/home/phobos/onionrouter/onionrouter/tor.git/.git |
22 |
-export STABLETAG=tor-0.2.2.16-alpha |
|
23 |
-export DEVTAG=tor-0.2.2.16-alpha |
|
22 |
+export STABLETAG=tor-0.2.2.17-alpha |
|
23 |
+export DEVTAG=tor-0.2.2.17-alpha |
|
24 | 24 |
|
25 | 25 |
WMLBASE=. |
26 | 26 |
SUBDIRS=docs eff projects press about download download getinvolved donate |
... | ... |
@@ -19,7 +19,7 @@ |
19 | 19 |
wmldir="$PWD" |
20 | 20 |
|
21 | 21 |
# Location of the po files, |
22 |
-podir="`dirname $wmldir`/translation/projects/website" |
|
22 |
+podir="`dirname $wmldir`/translation/projects/website/po" |
|
23 | 23 |
|
24 | 24 |
# A lot of the wml files have custom tags. These tags have been defined |
25 | 25 |
# in website/include/versions.wmi. Tags that people usually forget to close, |
... | ... |
@@ -96,35 +96,39 @@ for file in $po ; do |
96 | 96 |
# The location of the english wml file |
97 | 97 |
english="$wmldir/en/$wmlfile" |
98 | 98 |
|
99 |
- # Convert the files |
|
100 |
- po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/tmp-$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault" |
|
99 |
+ # Convert the translated file. Note that po4a will write the file and then delete it if less than 80% has been translated |
|
100 |
+ po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault" |
|
101 | 101 |
|
102 | 102 |
# Check to see if the file was written |
103 |
- if [ -e "$wmldir/$subdir/tmp-$wmlfile" ] |
|
103 |
+ if [ -e "$wmldir/$subdir/$wmlfile" ] |
|
104 | 104 |
then |
105 |
- mv "$wmldir/$subdir/tmp-$wmlfile" "$wmldir/$subdir/$wmlfile" |
|
106 |
- |
|
107 | 105 |
# Remove last three lines in file |
108 | 106 |
sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$wmlfile" |
109 | 107 |
|
110 | 108 |
# Include foot.wmi |
111 | 109 |
echo "#include <foot.wmi>" >> "$wmldir/$subdir/$wmlfile" |
110 |
+ |
|
111 |
+ # If the file is mirrors.wml, include mirrors-table.wmi |
|
112 |
+ if [ $wmlfile == "mirrors.wml" ] |
|
113 |
+ then |
|
114 |
+ sed -i 's/<!--PO4ASHARPBEGIN/#/' "$wmldir/$subdir/$wmlfile" |
|
115 |
+ sed -i 's/PO4ASHARPEND-->//' "$wmldir/$subdir/$wmlfile" |
|
116 |
+ fi |
|
112 | 117 |
fi |
113 | 118 |
} |
114 | 119 |
|
115 | 120 |
# Convert translations to directories such as website/torbrowser/nb/. |
121 |
+ # Again, po4a will write the file and then delete it if less than 80% has been translated |
|
116 | 122 |
function subdir { |
117 | 123 |
# The location of the english wml file |
118 | 124 |
english="$wmldir/$subdir/en/$wmlfile" |
119 | 125 |
|
120 | 126 |
# Convert the files |
121 |
- po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/$lang/tmp-$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault" |
|
127 |
+ po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/$lang/$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault" |
|
122 | 128 |
|
123 | 129 |
# Check to see if the file was written |
124 |
- if [ -e "$wmldir/$subdir/$lang/tmp-$wmlfile" ] |
|
130 |
+ if [ -e "$wmldir/$subdir/$lang/$wmlfile" ] |
|
125 | 131 |
then |
126 |
- mv "$wmldir/$subdir/$lang/tmp-$wmlfile" "$wmldir/$subdir/$lang/$wmlfile" |
|
127 |
- |
|
128 | 132 |
# Remove last three lines in file |
129 | 133 |
sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$lang/$wmlfile" |
130 | 134 |
|
... | ... |
@@ -569,6 +569,25 @@ my %m = ( |
569 | 569 |
httpsDistMirror => "", |
570 | 570 |
rsyncDistMirror => "", |
571 | 571 |
hiddenServiceMirror => "", |
572 |
+ }, |
|
573 |
+ |
|
574 |
+ mirror028 => { |
|
575 |
+ adminContact => "gouki", |
|
576 |
+ orgName => "5ª Coluna", |
|
577 |
+ isoCC => "PT", |
|
578 |
+ subRegion => "", |
|
579 |
+ region => "PT", |
|
580 |
+ ipv4 => "True", |
|
581 |
+ ipv6 => "False", |
|
582 |
+ loadBalanced => "No", |
|
583 |
+ httpWebsiteMirror => "http://tor-www.5coluna.com", |
|
584 |
+ httpsWebsiteMirror => "https://tor-www.5coluna.com", |
|
585 |
+ rsyncWebsiteMirror => "", |
|
586 |
+ ftpWebsiteMirror => "", |
|
587 |
+ httpDistMirror => "http://tor-www.5coluna.com/dist/", |
|
588 |
+ httpsDistMirror => "https://tor-www.5coluna.com/dist/", |
|
589 |
+ rsyncDistMirror => "", |
|
590 |
+ hiddenServiceMirror => "", |
|
572 | 591 |
} |
573 | 592 |
); |
574 | 593 |
|
... | ... |
@@ -6,9 +6,10 @@ |
6 | 6 |
# This is Free Software (GPLv3) |
7 | 7 |
# http://www.gnu.org/licenses/gpl-3.0.txt |
8 | 8 |
# |
9 |
-# This script will convert all of the english wml files to po files, and |
|
9 |
+# This script will convert all of the English wml files in |
|
10 |
+# https://svn.torproject.org/svn/website/trunk/ to pot files, and |
|
10 | 11 |
# keep them updated. The script will also convert subdirectories that |
11 |
-# exist in the english website module. |
|
12 |
+# exist in the website module. |
|
12 | 13 |
# |
13 | 14 |
# For more information, see the HOWTO and README in |
14 | 15 |
# translation/tools/gsoc09. |
... | ... |
@@ -19,19 +20,19 @@ |
19 | 20 |
# Location of the wml files |
20 | 21 |
wmldir="$PWD" |
21 | 22 |
|
22 |
-# Location of the po files. |
|
23 |
+# Location of the pot files. |
|
23 | 24 |
# Assuming that the translation directory is relative to the website |
24 |
-podir="`dirname $wmldir`/translation/projects/website" |
|
25 |
+podir="`dirname $wmldir`/translation/projects/website/po/templates" |
|
25 | 26 |
|
26 |
-# Set the copyright holder of the po files, |
|
27 |
+# Set the copyright holder of the files, |
|
27 | 28 |
# for example "The Tor Project, Inc" |
28 | 29 |
copyright="The Tor Project, Inc" |
29 | 30 |
|
30 | 31 |
# A lot of the wml files have custom tags. These tags have been defined |
31 | 32 |
# in website/include/versions.wmi. Tags that people usually forget to close, |
32 |
-# as well as tags that are not defined in versions.wmi have been added. |
|
33 |
+# as well as tags that are not defined in versions.wmi, have been added. |
|
33 | 34 |
# See: https://svn.torproject.org/svn/website/trunk/include/versions.wmi |
34 |
-customtag=`echo $(cat "$wmldir/include/versions.wmi" | awk '{ printf "<%s> " , $2 }' | sed 's/<>//g') "<svnsandbox> <svnwebsite> <svnprojects> <input> <hr> <br> <img> <gitblob> <version-android-components> <package-androidbundle-alpha> <package-androidbundle-alpha-sig>"` |
|
35 |
+customtag=`echo $(cat "$wmldir/include/versions.wmi" | awk '{ printf "<%s> " , $2 }' | sed 's/<>//g') "<svnsandbox> <svnwebsite> <svnprojects> <input> <hr> <br> <img> <gitblob> <version-android-components> <package-androidbundle-alpha> <package-androidbundle-alpha-sig> <version-androidbundle-tor> <video controls>"` |
|
35 | 36 |
|
36 | 37 |
# We also need to use the nodefault option of po4a; space separated list |
37 | 38 |
# of tags that the module should not try to set by default in any |
... | ... |
@@ -76,20 +77,11 @@ fi |
76 | 77 |
# Create the temp log |
77 | 78 |
touch $tmplog |
78 | 79 |
|
79 |
-# We need to find out which language directories we have. |
|
80 |
-# We also need to excluse the website module directory itself, as well |
|
81 |
-# as .svn |
|
82 |
-langdir=`find "$podir" -maxdepth 1 -type d ! -path "$podir" ! -path "$podir/templates" ! -path "*\.*" | sed "s#$podir/##"` |
|
83 |
- |
|
84 |
-# We only need the english wml files, but we do not wish to translate |
|
80 |
+# We only need the English wml files, but we do not wish to translate |
|
85 | 81 |
# the eff documents. |
86 | 82 |
wml=`find $wmldir -regex '^'$wmldir'/.*en/.*\.wml' -type f | grep -v '^'$wmldir'/eff'` |
87 | 83 |
|
88 |
-# For every language directory, create and/or update the po files. |
|
89 |
-for lang in $langdir ; do |
|
90 |
- |
|
91 |
- # For every english wml, see if the po needs to be created or |
|
92 |
- # updated |
|
84 |
+# For every English wml, see if the pot needs to be created or updated |
|
93 | 85 |
for file in $wml ; do |
94 | 86 |
|
95 | 87 |
# Get the basename of the file we are dealing with |
... | ... |
@@ -106,45 +98,45 @@ for lang in $langdir ; do |
106 | 98 |
continue |
107 | 99 |
fi |
108 | 100 |
|
109 |
- # Strip the file for its original extension and add .po |
|
110 |
- pofile="$priority.${wmlfile%%.*}.po" |
|
101 |
+ # Strip the file for its original extension and add .pot |
|
102 |
+ pofile="$priority.${wmlfile%%.*}.pot" |
|
111 | 103 |
|
112 | 104 |
# Find out what directory the file is in. |
113 |
- # Also, remove the parth of the path that is $wmldir |
|
105 |
+ # Also, remove the part of the path that is $wmldir |
|
114 | 106 |
indir=`dirname $file` |
115 | 107 |
|
116 | 108 |
# We need to know what one dir up is |
117 | 109 |
onedirup=`dirname $indir | sed "s#$wmldir/##"` |
118 | 110 |
|
119 |
- # We need to have the correct, full path to the po |
|
111 |
+ # We need to have the correct, full path to the pot |
|
120 | 112 |
# directory for the file we are working on. |
121 | 113 |
# Also, did the subdirectory exist prior to running this |
122 | 114 |
# script? If not, create it now and add it to the |
123 | 115 |
# repository. |
124 | 116 |
if [ $onedirup = $wmldir ] |
125 | 117 |
then |
126 |
- popath="$podir/$lang" |
|
118 |
+ popath="$podir" |
|
127 | 119 |
else |
128 | 120 |
|
129 | 121 |
# We need to know if a subdirectory, such as torbutton, |
130 | 122 |
# exist in the translation module. If it does not exist, |
131 | 123 |
# the script will create it in all the directories under |
132 | 124 |
# translation/projects/website (excluding .svn) |
133 |
- subdir=`find "$podir/$lang" -maxdepth 1 -type d ! -path "$ppodir/$lang" ! -path "*\.*"` |
|
125 |
+ subdir=`find "$podir" -maxdepth 1 -type d ! -path "$ppodir" ! -path "*\.*"` |
|
134 | 126 |
|
135 | 127 |
for dir in $subdir ; do |
136 |
- if [ ! -d "$podir/$lang/$onedirup" ] |
|
128 |
+ if [ ! -d "$podir/$onedirup" ] |
|
137 | 129 |
then |
138 |
- svn mkdir "$podir/$lang/$onedirup" |
|
130 |
+ svn mkdir "$podir/$onedirup" |
|
139 | 131 |
fi |
140 | 132 |
done |
141 | 133 |
|
142 | 134 |
# Set the path |
143 |
- popath="$podir/$lang/$onedirup" |
|
135 |
+ popath="$podir/$onedirup" |
|
144 | 136 |
|
145 | 137 |
fi |
146 | 138 |
|
147 |
- # Check to see if the po existed prior to running this |
|
139 |
+ # Check to see if the pot existed prior to running this |
|
148 | 140 |
# script. If it didn't, check if there any files with the same |
149 | 141 |
# filename, but different priority. If neither of the files |
150 | 142 |
# exist, create with po4a-gettextize. |
... | ... |
@@ -165,7 +157,7 @@ for lang in $langdir ; do |
165 | 157 |
poexist=0 |
166 | 158 |
fi |
167 | 159 |
|
168 |
- # If the po file does not exist, convert it with |
|
160 |
+ # If the pot file does not exist, convert it with |
|
169 | 161 |
# po4a-gettextize, set the right encoding and charset |
170 | 162 |
# and the correct copyright. |
171 | 163 |
if [ $poexist = 0 ] |
... | ... |
@@ -207,14 +199,14 @@ for lang in $langdir ; do |
207 | 199 |
rm -f "$popath/$pofile~" |
208 | 200 |
fi |
209 | 201 |
|
210 |
- # If the po file does exist, calculate the hash first, |
|
202 |
+ # If the pot file does exist, calculate the hash first, |
|
211 | 203 |
# then update the file, then calculate the hash again. |
212 | 204 |
if [ $poexist = 1 ] |
213 | 205 |
then |
214 | 206 |
# Calculate the hash before we update the file |
215 | 207 |
before=`grep -vE '^("POT-Creation-Date:|#)' "$popath/$pofile" | md5sum | cut -d " " -f1` |
216 | 208 |
|
217 |
- # Update the po file |
|
209 |
+ # Update the pot file |
|
218 | 210 |
po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault" |
219 | 211 |
|
220 | 212 |
# Calculate the new hash |
... | ... |
@@ -257,4 +249,3 @@ for lang in $langdir ; do |
257 | 249 |
# Delete the temp log |
258 | 250 |
rm -f $tmplog |
259 | 251 |
done |
260 |
-done |
|
261 | 252 |