... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
# |
3 | 3 |
# Author: Runa Sandvik, <runa.sandvik@gmail.com> |
4 | 4 |
# Google Summer of Code 2009 |
5 |
-# |
|
5 |
+# |
|
6 | 6 |
# This is Free Software (GPLv3) |
7 | 7 |
# http://www.gnu.org/licenses/gpl-3.0.txt |
8 | 8 |
# |
... | ... |
@@ -38,7 +38,7 @@ nodefault='<input>' |
38 | 38 |
# can run at any time. |
39 | 39 |
LOCKFILE=po2wml.lock |
40 | 40 |
|
41 |
-if lockfile -! -l 60 -r 3 "$LOCKFILE"; |
|
41 |
+if lockfile -! -l 60 -r 3 "$LOCKFILE"; |
|
42 | 42 |
then |
43 | 43 |
echo "unable to acquire lock" >2 |
44 | 44 |
exit 1 |
... | ... |
@@ -66,13 +66,13 @@ for file in $po ; do |
66 | 66 |
validate_script="`dirname $wmldir`/translation/tools/validate.py" |
67 | 67 |
validate_log="`dirname $wmldir`/validate/website-validate.log" |
68 | 68 |
python "$validate_script" -i "$file" -l "$validate_log" |
69 |
- |
|
69 |
+ |
|
70 | 70 |
# Get the basename of the file we are dealing with |
71 | 71 |
pofile=`basename $file` |
72 | 72 |
|
73 | 73 |
# Strip the file for its original extension and the translation |
74 | 74 |
# priority, and add .wml |
75 |
- wmlfile="`echo $pofile | cut -d . -f 2`.wml" |
|
75 |
+ wmlfile="`echo $pofile | cut -d . -f 2`.wml" |
|
76 | 76 |
|
77 | 77 |
# Find out what directory the file is in. |
78 | 78 |
indir=`dirname $file` |
... | ... |
@@ -168,7 +168,7 @@ for file in $po ; do |
168 | 168 |
then |
169 | 169 |
new_side=`echo '#include "de/side.wmi"'` |
170 | 170 |
sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
171 |
- fi |
|
171 |
+ fi |
|
172 | 172 |
|
173 | 173 |
# Info (not all files include this) |
174 | 174 |
orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
... | ... |
@@ -176,11 +176,11 @@ for file in $po ; do |
176 | 176 |
then |
177 | 177 |
new_info=`echo '#include "de/info.wmi"'` |
178 | 178 |
sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
179 |
- fi |
|
179 |
+ fi |
|
180 | 180 |
|
181 | 181 |
# Footer |
182 | 182 |
echo '#include "de/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
183 |
- fi |
|
183 |
+ fi |
|
184 | 184 |
|
185 | 185 |
# If the translation is Arabic, include the |
186 | 186 |
# correct header, css, menu files and footer |
... | ... |
@@ -189,7 +189,7 @@ for file in $po ; do |
189 | 189 |
# Head |
190 | 190 |
orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
191 | 191 |
temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@` |
192 |
- new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
192 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.min.css"'` |
|
193 | 193 |
sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
194 | 194 |
|
195 | 195 |
# Side (not all files include this) |
... | ... |
@@ -219,7 +219,7 @@ for file in $po ; do |
219 | 219 |
# Head |
220 | 220 |
orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
221 | 221 |
temp_head=`echo $orig_head | sed s@head.wmi@fa/head.wmi@` |
222 |
- new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
222 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.min.css"'` |
|
223 | 223 |
sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
224 | 224 |
|
225 | 225 |
# Side (not all files include this) |
... | ... |
@@ -250,7 +250,7 @@ for file in $po ; do |
250 | 250 |
cp "$wmldir/en/sidenav.wmi" "$wmldir/$subdir" |
251 | 251 |
fi |
252 | 252 |
fi |
253 |
- } |
|
253 |
+ } |
|
254 | 254 |
|
255 | 255 |
# Convert translations to directories such as website/torbrowser/nb/. |
256 | 256 |
# Again, po4a will write the file and then delete it if less than 80% has been translated |
... | ... |
@@ -273,7 +273,7 @@ for file in $po ; do |
273 | 273 |
sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$lang/$wmlfile" |
274 | 274 |
|
275 | 275 |
# Remove a specific comment from a specific file |
276 |
- if [ $wmlfile == "download-easy.wml" ] |
|
276 |
+ if [ $wmlfile == "download-easy.wml" ] |
|
277 | 277 |
then |
278 | 278 |
translator_comment="# Translators: please point to the version of TBB in your language, if there is one." |
279 | 279 |
sed -i "s/$translator_comment//" "$wmldir/$subdir/$lang/$wmlfile" |
... | ... |
@@ -289,7 +289,7 @@ for file in $po ; do |
289 | 289 |
fi |
290 | 290 |
|
291 | 291 |
# Include the English footer for most of the |
292 |
- # translations |
|
292 |
+ # translations |
|
293 | 293 |
if [[ $lang != "ar" && $lang != "pl" && $lang != "de" && $lang != "fa" ]] |
294 | 294 |
then |
295 | 295 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
... | ... |
@@ -297,8 +297,8 @@ for file in $po ; do |
297 | 297 |
|
298 | 298 |
# If the file is overview.wml, make sure we |
299 | 299 |
# include the correct set of images |
300 |
- if [ $wmlfile = "overview.wml" ] && [[ $lang = "de" || $lang = "es" || $lang = "fr" || |
|
301 |
- $lang = "ja" || $lang = "nl" || $lang = "no" || $lang = "pl" || $lang = "ru" || |
|
300 |
+ if [ $wmlfile = "overview.wml" ] && [[ $lang = "de" || $lang = "es" || $lang = "fr" || |
|
301 |
+ $lang = "ja" || $lang = "nl" || $lang = "no" || $lang = "pl" || $lang = "ru" || |
|
302 | 302 |
$lang = "zh" ]] |
303 | 303 |
then |
304 | 304 |
sed -i "s/htw1.png/htw1_$lang.png/" "$wmldir/$subdir/$lang/$wmlfile" |
... | ... |
@@ -368,7 +368,7 @@ for file in $po ; do |
368 | 368 |
orig_video=`grep src=\"https:\/\/media.torproject.org\/video\/2009-install-and-use-tor.ogv\" "$wmldir/$subdir/$lang/$wmlfile"` |
369 | 369 |
translated_video=`echo "<p>Das nachfolgende Video, wurde von SemperVideo erstellt.</p> <p><video id=\"v1\" src=\"https://media.torproject.org/video/2011-install-and-use-tor-de.ogv\" autobuffer=\"true\" controls=\"controls\"></video></p>"` |
370 | 370 |
new_video=`echo "$orig_video $translated_video"` |
371 |
- |
|
371 |
+ |
|
372 | 372 |
sed -i "s@$orig_video@$new_video@" "$wmldir/$subdir/$lang/$wmlfile" |
373 | 373 |
fi |
374 | 374 |
fi |
... | ... |
@@ -380,7 +380,7 @@ for file in $po ; do |
380 | 380 |
# Head |
381 | 381 |
orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
382 | 382 |
temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@` |
383 |
- new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
383 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.min.css"'` |
|
384 | 384 |
sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
385 | 385 |
|
386 | 386 |
# Side (not all files include this) |
... | ... |
@@ -410,7 +410,7 @@ for file in $po ; do |
410 | 410 |
# Head |
411 | 411 |
orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
412 | 412 |
temp_head=`echo $orig_head | sed s@head.wmi@fa/head.wmi@` |
413 |
- new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
413 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.min.css"'` |
|
414 | 414 |
sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
415 | 415 |
|
416 | 416 |
# Side (not all files include this) |
... | ... |
@@ -434,7 +434,7 @@ for file in $po ; do |
434 | 434 |
fi |
435 | 435 |
|
436 | 436 |
# If the directory does not include sidenav.wmi, |
437 |
- # copy it from the English directory (only if |
|
437 |
+ # copy it from the English directory (only if |
|
438 | 438 |
# the English directory has this file) |
439 | 439 |
if [[ ! -e "$wmldir/$subdir/$lang/sidenav.wmi" && -e "$wmldir/$subdir/en/sidenav.wmi" ]] |
440 | 440 |
then |
... | ... |
@@ -474,7 +474,7 @@ for file in $po ; do |
474 | 474 |
then |
475 | 475 |
subdir="`echo $subdir | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
476 | 476 |
nosubdir |
477 |
- fi |
|
477 |
+ fi |
|
478 | 478 |
|
479 | 479 |
# Convert everything else |
480 | 480 |
if [[ $subdir != "en" && $subdir != "pl_PL" && ! ($subdir =~ "_") && $subdir != "nb" && $subdir != "sv" ]] |
... | ... |
@@ -259,7 +259,12 @@ for file in $po ; do |
259 | 259 |
english="$wmldir/$subdir/en/$wmlfile" |
260 | 260 |
|
261 | 261 |
# Convert the files |
262 |
- 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" |
|
262 |
+ if [ $wmlfile = "download.wml" ] |
|
263 |
+ then |
|
264 |
+ 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" -o ontagerror="silent" |
|
265 |
+ else |
|
266 |
+ 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" |
|
267 |
+ fi |
|
263 | 268 |
|
264 | 269 |
# Check to see if the file was written |
265 | 270 |
if [ -e "$wmldir/$subdir/$lang/$wmlfile" ] |
... | ... |
@@ -274,6 +279,15 @@ for file in $po ; do |
274 | 279 |
sed -i "s/$translator_comment//" "$wmldir/$subdir/$lang/$wmlfile" |
275 | 280 |
fi |
276 | 281 |
|
282 |
+ # Fix download.wml |
|
283 |
+ if [ $wmlfile = "download.wml" ] |
|
284 |
+ then |
|
285 |
+ sed -i 's/<!--PO4ASHARPBEGINinclude <lang.wmi>/#include <lang.wmi>/g' "$wmldir/$subdir/$lang/$wmlfile" |
|
286 |
+ sed -i 's/<!--PO4ASHARPBEGINinclude <foot.wmi>//g' "$wmldir/$subdir/$lang/$wmlfile" |
|
287 |
+ sed -i 's/<!--PO4ASHARPBEGIN//g;s/PO4ASHARPEND-->//g' "$wmldir/$subdir/$lang/$wmlfile" |
|
288 |
+ echo "#include <foot.wmi>" >> "$wmldir/$subdir/$lang/$wmlfile" |
|
289 |
+ fi |
|
290 |
+ |
|
277 | 291 |
# Include the English footer for most of the |
278 | 292 |
# translations |
279 | 293 |
if [[ $lang != "ar" && $lang != "pl" && $lang != "de" && $lang != "fa" ]] |
... | ... |
@@ -119,7 +119,7 @@ for file in $po ; do |
119 | 119 |
|
120 | 120 |
# Include the English footer for most of the |
121 | 121 |
# translations |
122 |
- if [[ $subdir != "ar" && $subdir != "pl" && $subdir != "de" ]] |
|
122 |
+ if [[ $subdir != "ar" && $subdir != "pl" && $subdir != "de" && $subdir != "fa" ]] |
|
123 | 123 |
then |
124 | 124 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
125 | 125 |
fi |
... | ... |
@@ -276,7 +276,7 @@ for file in $po ; do |
276 | 276 |
|
277 | 277 |
# Include the English footer for most of the |
278 | 278 |
# translations |
279 |
- if [[ $lang != "ar" && $lang != "pl" && $lang != "de" ]] |
|
279 |
+ if [[ $lang != "ar" && $lang != "pl" && $lang != "de" && $lang != "fa" ]] |
|
280 | 280 |
then |
281 | 281 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
282 | 282 |
fi |
... | ... |
@@ -389,6 +389,36 @@ for file in $po ; do |
389 | 389 |
echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
390 | 390 |
fi |
391 | 391 |
|
392 |
+ # If the file is a Farsi translation, include the |
|
393 |
+ # correct header, css, menu files and footer |
|
394 |
+ if [ $lang = "fa" ] |
|
395 |
+ then |
|
396 |
+ # Head |
|
397 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
398 |
+ temp_head=`echo $orig_head | sed s@head.wmi@fa/head.wmi@` |
|
399 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
400 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
|
401 |
+ |
|
402 |
+ # Side (not all files include this) |
|
403 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
404 |
+ if [ -n "$orig_side" ] |
|
405 |
+ then |
|
406 |
+ new_side=`echo '#include "fa/side.wmi"'` |
|
407 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile" |
|
408 |
+ fi |
|
409 |
+ |
|
410 |
+ # Info (not all files include this) |
|
411 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
412 |
+ if [ -n "$orig_info" ] |
|
413 |
+ then |
|
414 |
+ new_info=`echo '#include "fa/info.wmi"'` |
|
415 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile" |
|
416 |
+ fi |
|
417 |
+ |
|
418 |
+ # Footer |
|
419 |
+ echo '#include "fa/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
|
420 |
+ fi |
|
421 |
+ |
|
392 | 422 |
# If the directory does not include sidenav.wmi, |
393 | 423 |
# copy it from the English directory (only if |
394 | 424 |
# the English directory has this file) |
... | ... |
@@ -212,6 +212,36 @@ for file in $po ; do |
212 | 212 |
echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
213 | 213 |
fi |
214 | 214 |
|
215 |
+ # If the translation is Farsi, include the |
|
216 |
+ # correct header, css, menu files and footer |
|
217 |
+ if [ $subdir = "fa" ] |
|
218 |
+ then |
|
219 |
+ # Head |
|
220 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
221 |
+ temp_head=`echo $orig_head | sed s@head.wmi@fa/head.wmi@` |
|
222 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
223 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
|
224 |
+ |
|
225 |
+ # Side (not all files include this) |
|
226 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
227 |
+ if [ -n "$orig_side" ] |
|
228 |
+ then |
|
229 |
+ new_side=`echo '#include "fa/side.wmi"'` |
|
230 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
|
231 |
+ fi |
|
232 |
+ |
|
233 |
+ # Info (not all files include this) |
|
234 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
235 |
+ if [ -n "$orig_info" ] |
|
236 |
+ then |
|
237 |
+ new_info=`echo '#include "fa/info.wmi"'` |
|
238 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
|
239 |
+ fi |
|
240 |
+ |
|
241 |
+ # Footer |
|
242 |
+ echo '#include "fa/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
|
243 |
+ fi |
|
244 |
+ |
|
215 | 245 |
# If the directory does not include sidenav.wmi, |
216 | 246 |
# copy it from the English directory (only if |
217 | 247 |
# the English directory has this file) |
... | ... |
@@ -373,14 +373,6 @@ for file in $po ; do |
373 | 373 |
# subdirectory. |
374 | 374 |
if [ $onedirup == $lang ] |
375 | 375 |
then |
376 |
- # If the current subdirectory is of the form "xx_XX", |
|
377 |
- # rename to "xx-xx" instead (except for pl_PL) |
|
378 |
- if [[ $subdir =~ "_" && $subdir != "pl_PL" ]] |
|
379 |
- then |
|
380 |
- subdir="`echo $subdir | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
|
381 |
- nosubdir |
|
382 |
- fi |
|
383 |
- |
|
384 | 376 |
# If the current directory is "pl_PL" use "pl" instead |
385 | 377 |
if [ $subdir = "pl_PL" ] |
386 | 378 |
then |
... | ... |
@@ -402,20 +394,20 @@ for file in $po ; do |
402 | 394 |
nosubdir |
403 | 395 |
fi |
404 | 396 |
|
397 |
+ # If the current subdirectory is of the form "xx_XX", |
|
398 |
+ # rename to "xx-xx" instead (except for pl_PL) |
|
399 |
+ if [[ $subdir =~ "_" && $subdir != "pl_PL" ]] |
|
400 |
+ then |
|
401 |
+ subdir="`echo $subdir | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
|
402 |
+ nosubdir |
|
403 |
+ fi |
|
404 |
+ |
|
405 | 405 |
# Convert everything else |
406 | 406 |
if [[ $subdir != "en" && $subdir != "pl_PL" && ! ($subdir =~ "_") && $subdir != "nb" && $subdir != "sv" ]] |
407 | 407 |
then |
408 | 408 |
nosubdir |
409 | 409 |
fi |
410 | 410 |
else |
411 |
- # If the current languge is of the form "xx_XX", rename |
|
412 |
- # to "xx-xx" instead (except for pl_PL) |
|
413 |
- if [[ $lang =~ "_" && $lang != "pl_PL" ]] |
|
414 |
- then |
|
415 |
- lang="`echo $lang | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
|
416 |
- subdir |
|
417 |
- fi |
|
418 |
- |
|
419 | 411 |
# If the current language is "pl_PL" use "pl" instead |
420 | 412 |
if [ $lang = "pl_PL" ] |
421 | 413 |
then |
... | ... |
@@ -436,7 +428,15 @@ for file in $po ; do |
436 | 428 |
lang="se" |
437 | 429 |
subdir |
438 | 430 |
fi |
439 |
- |
|
431 |
+ |
|
432 |
+ # If the current languge is of the form "xx_XX", rename |
|
433 |
+ # to "xx-xx" instead (except for pl_PL) |
|
434 |
+ if [[ $lang =~ "_" && $lang != "pl_PL" ]] |
|
435 |
+ then |
|
436 |
+ lang="`echo $lang | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
|
437 |
+ subdir |
|
438 |
+ fi |
|
439 |
+ |
|
440 | 440 |
# Convert everything else |
441 | 441 |
if [[ $lang != "en" && $lang != "pl_PL" && ! ($lang =~ "_") && $lang != "nb" && $lang != "sv" ]] |
442 | 442 |
then |
... | ... |
@@ -410,7 +410,7 @@ for file in $po ; do |
410 | 410 |
else |
411 | 411 |
# If the current languge is of the form "xx_XX", rename |
412 | 412 |
# to "xx-xx" instead (except for pl_PL) |
413 |
- if [[ $lang =~ "_" && $subdir != "pl_PL" ]] |
|
413 |
+ if [[ $lang =~ "_" && $lang != "pl_PL" ]] |
|
414 | 414 |
then |
415 | 415 |
lang="`echo $lang | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
416 | 416 |
subdir |
... | ... |
@@ -373,20 +373,21 @@ for file in $po ; do |
373 | 373 |
# subdirectory. |
374 | 374 |
if [ $onedirup == $lang ] |
375 | 375 |
then |
376 |
- # If the current subdirectory is "zh_CN" use "zh-cn" instead |
|
377 |
- if [ $subdir = "zh_CN" ] |
|
376 |
+ # If the current subdirectory is of the form "xx_XX", |
|
377 |
+ # rename to "xx-xx" instead (except for pl_PL) |
|
378 |
+ if [[ $subdir =~ "_" && $subdir != "pl_PL" ]] |
|
378 | 379 |
then |
379 |
- subdir="zh-cn" |
|
380 |
+ subdir="`echo $subdir | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
|
380 | 381 |
nosubdir |
381 | 382 |
fi |
382 | 383 |
|
383 |
- # If the current subdirectory is "pt_BR" use "pt-br" instead |
|
384 |
- if [ $subdir = "pt_BR" ] |
|
384 |
+ # If the current directory is "pl_PL" use "pl" instead |
|
385 |
+ if [ $subdir = "pl_PL" ] |
|
385 | 386 |
then |
386 |
- subdir="pt-br" |
|
387 |
+ subdir="pl" |
|
387 | 388 |
nosubdir |
388 | 389 |
fi |
389 |
- |
|
390 |
+ |
|
390 | 391 |
# If the current directory is "nb" use "no" instead |
391 | 392 |
if [ $subdir = "nb" ] |
392 | 393 |
then |
... | ... |
@@ -401,30 +402,24 @@ for file in $po ; do |
401 | 402 |
nosubdir |
402 | 403 |
fi |
403 | 404 |
|
404 |
- # If the current directory is "pl_PL" use "pl" instead |
|
405 |
- if [ $subdir = "pl_PL" ] |
|
406 |
- then |
|
407 |
- subdir="pl" |
|
408 |
- nosubdir |
|
409 |
- fi |
|
410 |
- |
|
411 | 405 |
# Convert everything else |
412 |
- if [[ $subdir != "en" && $subdir != "zh_CN" && $subdir != "pt_BR" && $subdir != "nb" && $subdir != "sv" && $subdir != "pl_PL" ]] |
|
406 |
+ if [[ $subdir != "en" && $subdir != "pl_PL" && ! ($subdir =~ "_") && $subdir != "nb" && $subdir != "sv" ]] |
|
413 | 407 |
then |
414 | 408 |
nosubdir |
415 | 409 |
fi |
416 | 410 |
else |
417 |
- # If the current language is "zh_CN" use "zh-cn" instead |
|
418 |
- if [ $lang = "zh_CN" ] |
|
411 |
+ # If the current languge is of the form "xx_XX", rename |
|
412 |
+ # to "xx-xx" instead (except for pl_PL) |
|
413 |
+ if [[ $lang =~ "_" && $subdir != "pl_PL" ]] |
|
419 | 414 |
then |
420 |
- lang="zh-cn" |
|
415 |
+ lang="`echo $lang | sed s/_/-/ | tr '[A-Z]' '[a-z]'`" |
|
421 | 416 |
subdir |
422 | 417 |
fi |
423 | 418 |
|
424 |
- # If the current language is "pt_BR" use "pt-br" instead |
|
425 |
- if [ $lang = "pt_BR" ] |
|
419 |
+ # If the current language is "pl_PL" use "pl" instead |
|
420 |
+ if [ $lang = "pl_PL" ] |
|
426 | 421 |
then |
427 |
- lang="pt-br" |
|
422 |
+ $lang="pl" |
|
428 | 423 |
subdir |
429 | 424 |
fi |
430 | 425 |
|
... | ... |
@@ -442,15 +437,8 @@ for file in $po ; do |
442 | 437 |
subdir |
443 | 438 |
fi |
444 | 439 |
|
445 |
- # If the current language is "pl_PL" use "pl" instead |
|
446 |
- if [ $lang = "pl_PL" ] |
|
447 |
- then |
|
448 |
- lang="pl" |
|
449 |
- subdir |
|
450 |
- fi |
|
451 |
- |
|
452 | 440 |
# Convert everything else |
453 |
- if [[ $lang != "en" && $lang != "zh_CN" && $lang != "pt_BR" && $lang != "nb" && $lang != "sv" && $lang != "pl_PL" ]] |
|
441 |
+ if [[ $lang != "en" && $lang != "pl_PL" && ! ($lang =~ "_") && $lang != "nb" && $lang != "sv" ]] |
|
454 | 442 |
then |
455 | 443 |
subdir |
456 | 444 |
fi |
... | ... |
@@ -322,10 +322,10 @@ for file in $po ; do |
322 | 322 |
if [ $wmlfile = "tor-doc-windows.wml" ] |
323 | 323 |
then |
324 | 324 |
orig_video=`grep src=\"https:\/\/media.torproject.org\/video\/2009-install-and-use-tor.ogv\" "$wmldir/$subdir/$lang/$wmlfile"` |
325 |
- new_video=`echo "<p>Das nachfolgende Video, wurde von <a href=\"http://www.sempervideo.de/\">SemperVideo</a> erstellt.</p> $orig_video"` |
|
325 |
+ translated_video=`echo "<p>Das nachfolgende Video, wurde von SemperVideo erstellt.</p> <p><video id=\"v1\" src=\"https://media.torproject.org/video/2011-install-and-use-tor-de.ogv\" autobuffer=\"true\" controls=\"controls\"></video></p>"` |
|
326 |
+ new_video=`echo "$orig_video $translated_video"` |
|
326 | 327 |
|
327 | 328 |
sed -i "s@$orig_video@$new_video@" "$wmldir/$subdir/$lang/$wmlfile" |
328 |
- sed -i "s@src\=\"https://media.torproject.org/video/2009-install-and-use-tor.ogv\"@src\=\"https://media.torproject.org/video/2011-install-and-use-tor-de.ogv\"@" "$wmldir/$subdir/$lang/$wmlfile" |
|
329 | 329 |
fi |
330 | 330 |
fi |
331 | 331 |
|
... | ... |
@@ -379,6 +379,13 @@ for file in $po ; do |
379 | 379 |
subdir="zh-cn" |
380 | 380 |
nosubdir |
381 | 381 |
fi |
382 |
+ |
|
383 |
+ # If the current subdirectory is "pt_BR" use "pt-br" instead |
|
384 |
+ if [ $subdir = "pt_BR" ] |
|
385 |
+ then |
|
386 |
+ subdir="pt-br" |
|
387 |
+ nosubdir |
|
388 |
+ fi |
|
382 | 389 |
|
383 | 390 |
# If the current directory is "nb" use "no" instead |
384 | 391 |
if [ $subdir = "nb" ] |
... | ... |
@@ -402,7 +409,7 @@ for file in $po ; do |
402 | 409 |
fi |
403 | 410 |
|
404 | 411 |
# Convert everything else |
405 |
- if [[ $subdir != "en" && $subdir != "zh_CN" && $subdir != "nb" && $subdir != "sv" && $subdir != "pl_PL" ]] |
|
412 |
+ if [[ $subdir != "en" && $subdir != "zh_CN" && $subdir != "pt_BR" && $subdir != "nb" && $subdir != "sv" && $subdir != "pl_PL" ]] |
|
406 | 413 |
then |
407 | 414 |
nosubdir |
408 | 415 |
fi |
... | ... |
@@ -414,6 +421,13 @@ for file in $po ; do |
414 | 421 |
subdir |
415 | 422 |
fi |
416 | 423 |
|
424 |
+ # If the current language is "pt_BR" use "pt-br" instead |
|
425 |
+ if [ $lang = "pt_BR" ] |
|
426 |
+ then |
|
427 |
+ lang="pt-br" |
|
428 |
+ subdir |
|
429 |
+ fi |
|
430 |
+ |
|
417 | 431 |
# If the current language is "nb" use "no" instead |
418 | 432 |
if [ $lang = "nb" ] |
419 | 433 |
then |
... | ... |
@@ -436,7 +450,7 @@ for file in $po ; do |
436 | 450 |
fi |
437 | 451 |
|
438 | 452 |
# Convert everything else |
439 |
- if [[ $lang != "en" && $lang != "zh_CN" && $lang != "nb" && $lang != "sv" && $lang != "pl_PL" ]] |
|
453 |
+ if [[ $lang != "en" && $lang != "zh_CN" && $lang != "pt_BR" && $lang != "nb" && $lang != "sv" && $lang != "pl_PL" ]] |
|
440 | 454 |
then |
441 | 455 |
subdir |
442 | 456 |
fi |
... | ... |
@@ -321,7 +321,11 @@ for file in $po ; do |
321 | 321 |
# sure we include the German video |
322 | 322 |
if [ $wmlfile = "tor-doc-windows.wml" ] |
323 | 323 |
then |
324 |
- sed -i "s@src\=\"https://media.torproject.org/video/2009-install-and-use-tor.ogv\"@src\=\"https://media.torproject.org/video/2011-install-and-use-tor-de.mp4@" "$wmldir/$subdir/$lang/$wmlfile" |
|
324 |
+ orig_video=`grep src=\"https:\/\/media.torproject.org\/video\/2009-install-and-use-tor.ogv\" "$wmldir/$subdir/$lang/$wmlfile"` |
|
325 |
+ new_video=`echo "<p>Das nachfolgende Video, wurde von <a href=\"http://www.sempervideo.de/\">SemperVideo</a> erstellt.</p> $orig_video"` |
|
326 |
+ |
|
327 |
+ sed -i "s@$orig_video@$new_video@" "$wmldir/$subdir/$lang/$wmlfile" |
|
328 |
+ sed -i "s@src\=\"https://media.torproject.org/video/2009-install-and-use-tor.ogv\"@src\=\"https://media.torproject.org/video/2011-install-and-use-tor-de.ogv\"@" "$wmldir/$subdir/$lang/$wmlfile" |
|
325 | 329 |
fi |
326 | 330 |
fi |
327 | 331 |
|
... | ... |
@@ -316,6 +316,13 @@ for file in $po ; do |
316 | 316 |
|
317 | 317 |
# Footer |
318 | 318 |
echo '#include "de/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
319 |
+ |
|
320 |
+ # If the file is tor-doc-windows, make |
|
321 |
+ # sure we include the German video |
|
322 |
+ if [ $wmlfile = "tor-doc-windows.wml" ] |
|
323 |
+ then |
|
324 |
+ sed -i "s@src\=\"https://media.torproject.org/video/2009-install-and-use-tor.ogv\"@src\=\"https://media.torproject.org/video/2011-install-and-use-tor-de.mp4@" "$wmldir/$subdir/$lang/$wmlfile" |
|
325 |
+ fi |
|
319 | 326 |
fi |
320 | 327 |
|
321 | 328 |
# If the file is an Arabic translation, include the |
... | ... |
@@ -251,6 +251,17 @@ for file in $po ; do |
251 | 251 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
252 | 252 |
fi |
253 | 253 |
|
254 |
+ # If the file is overview.wml, make sure we |
|
255 |
+ # include the correct set of images |
|
256 |
+ if [ $wmlfile = "overview.wml" ] && [[ $lang = "de" || $lang = "es" || $lang = "fr" || |
|
257 |
+ $lang = "ja" || $lang = "nl" || $lang = "no" || $lang = "pl" || $lang = "ru" || |
|
258 |
+ $lang = "zh" ]] |
|
259 |
+ then |
|
260 |
+ sed -i "s/htw1.png/htw1_$lang.png/" "$wmldir/$subdir/$lang/$wmlfile" |
|
261 |
+ sed -i "s/htw2.png/htw2_$lang.png/" "$wmldir/$subdir/$lang/$wmlfile" |
|
262 |
+ sed -i "s/htw3.png/htw3_$lang.png/" "$wmldir/$subdir/$lang/$wmlfile" |
|
263 |
+ fi |
|
264 |
+ |
|
254 | 265 |
# If the translation is Polish, include the |
255 | 266 |
# correct header, menu files and footer |
256 | 267 |
if [ $lang = "pl" ] |
... | ... |
@@ -246,7 +246,7 @@ for file in $po ; do |
246 | 246 |
|
247 | 247 |
# Include the English footer for most of the |
248 | 248 |
# translations |
249 |
- if [[ $lang != "ar" && $lang != "pl" && $subdir != "de" ]] |
|
249 |
+ if [[ $lang != "ar" && $lang != "pl" && $lang != "de" ]] |
|
250 | 250 |
then |
251 | 251 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
252 | 252 |
fi |
... | ... |
@@ -119,7 +119,7 @@ for file in $po ; do |
119 | 119 |
|
120 | 120 |
# Include the English footer for most of the |
121 | 121 |
# translations |
122 |
- if [[ $subdir != "ar" && $subdir != "pl" ]] |
|
122 |
+ if [[ $subdir != "ar" && $subdir != "pl" && $subdir != "de" ]] |
|
123 | 123 |
then |
124 | 124 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
125 | 125 |
fi |
... | ... |
@@ -153,6 +153,35 @@ for file in $po ; do |
153 | 153 |
echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
154 | 154 |
fi |
155 | 155 |
|
156 |
+ # If the translation is German, include the |
|
157 |
+ # correct header, menu files and footer |
|
158 |
+ if [ $subdir = "de" ] |
|
159 |
+ then |
|
160 |
+ # Head |
|
161 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
162 |
+ new_head=`echo $orig_head | sed s@head.wmi@de/head.wmi@` |
|
163 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
|
164 |
+ |
|
165 |
+ # Side (not all files include this) |
|
166 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
167 |
+ if [ -n "$orig_side" ] |
|
168 |
+ then |
|
169 |
+ new_side=`echo '#include "de/side.wmi"'` |
|
170 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
|
171 |
+ fi |
|
172 |
+ |
|
173 |
+ # Info (not all files include this) |
|
174 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
175 |
+ if [ -n "$orig_info" ] |
|
176 |
+ then |
|
177 |
+ new_info=`echo '#include "de/info.wmi"'` |
|
178 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
|
179 |
+ fi |
|
180 |
+ |
|
181 |
+ # Footer |
|
182 |
+ echo '#include "de/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
|
183 |
+ fi |
|
184 |
+ |
|
156 | 185 |
# If the translation is Arabic, include the |
157 | 186 |
# correct header, css, menu files and footer |
158 | 187 |
if [ $subdir = "ar" ] |
... | ... |
@@ -217,7 +246,7 @@ for file in $po ; do |
217 | 246 |
|
218 | 247 |
# Include the English footer for most of the |
219 | 248 |
# translations |
220 |
- if [[ $lang != "ar" && $lang != "pl" ]] |
|
249 |
+ if [[ $lang != "ar" && $lang != "pl" && $subdir != "de" ]] |
|
221 | 250 |
then |
222 | 251 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
223 | 252 |
fi |
... | ... |
@@ -250,6 +279,34 @@ for file in $po ; do |
250 | 279 |
echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
251 | 280 |
fi |
252 | 281 |
|
282 |
+ # If the translation is German, include the |
|
283 |
+ # correct header, menu files and footer |
|
284 |
+ if [ $lang = "de" ] |
|
285 |
+ then |
|
286 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
287 |
+ new_head=`echo $orig_head | sed s@head.wmi@de/head.wmi@` |
|
288 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
|
289 |
+ |
|
290 |
+ # Side (not all files include this) |
|
291 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
292 |
+ if [ -n "$orig_side" ] |
|
293 |
+ then |
|
294 |
+ new_side=`echo '#include "de/side.wmi"'` |
|
295 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile" |
|
296 |
+ fi |
|
297 |
+ |
|
298 |
+ # Info (not all files include this) |
|
299 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
300 |
+ if [ -n "$orig_info" ] |
|
301 |
+ then |
|
302 |
+ new_info=`echo '#include "de/info.wmi"'` |
|
303 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile" |
|
304 |
+ fi |
|
305 |
+ |
|
306 |
+ # Footer |
|
307 |
+ echo '#include "de/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
|
308 |
+ fi |
|
309 |
+ |
|
253 | 310 |
# If the file is an Arabic translation, include the |
254 | 311 |
# correct header, css, menu files and footer |
255 | 312 |
if [ $lang = "ar" ] |
... | ... |
@@ -124,6 +124,65 @@ for file in $po ; do |
124 | 124 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
125 | 125 |
fi |
126 | 126 |
|
127 |
+ # If the translation is Polish, include the |
|
128 |
+ # correct header, menu files and footer |
|
129 |
+ if [ $subdir = "pl" ] |
|
130 |
+ then |
|
131 |
+ # Head |
|
132 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
133 |
+ new_head=`echo $orig_head | sed s@head.wmi@pl/head.wmi@` |
|
134 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
|
135 |
+ |
|
136 |
+ # Side (not all files include this) |
|
137 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
138 |
+ if [ -n "$orig_side" ] |
|
139 |
+ then |
|
140 |
+ new_side=`echo '#include "pl/side.wmi"'` |
|
141 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
|
142 |
+ fi |
|
143 |
+ |
|
144 |
+ # Info (not all files include this) |
|
145 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
146 |
+ if [ -n "$orig_info" ] |
|
147 |
+ then |
|
148 |
+ new_info=`echo '#include "pl/info.wmi"'` |
|
149 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
|
150 |
+ fi |
|
151 |
+ |
|
152 |
+ # Footer |
|
153 |
+ echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
|
154 |
+ fi |
|
155 |
+ |
|
156 |
+ # If the translation is Arabic, include the |
|
157 |
+ # correct header, css, menu files and footer |
|
158 |
+ if [ $subdir = "ar" ] |
|
159 |
+ then |
|
160 |
+ # Head |
|
161 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
162 |
+ temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@` |
|
163 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
164 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
|
165 |
+ |
|
166 |
+ # Side (not all files include this) |
|
167 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
168 |
+ if [ -n "$orig_side" ] |
|
169 |
+ then |
|
170 |
+ new_side=`echo '#include "ar/side.wmi"'` |
|
171 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
|
172 |
+ fi |
|
173 |
+ |
|
174 |
+ # Info (not all files include this) |
|
175 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
176 |
+ if [ -n "$orig_info" ] |
|
177 |
+ then |
|
178 |
+ new_info=`echo '#include "ar/info.wmi"'` |
|
179 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
|
180 |
+ fi |
|
181 |
+ |
|
182 |
+ # Footer |
|
183 |
+ echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
|
184 |
+ fi |
|
185 |
+ |
|
127 | 186 |
# If the directory does not include sidenav.wmi, |
128 | 187 |
# copy it from the English directory (only if |
129 | 188 |
# the English directory has this file) |
... | ... |
@@ -131,7 +190,6 @@ for file in $po ; do |
131 | 190 |
then |
132 | 191 |
cp "$wmldir/en/sidenav.wmi" "$wmldir/$subdir" |
133 | 192 |
fi |
134 |
- |
|
135 | 193 |
fi |
136 | 194 |
} |
137 | 195 |
|
... | ... |
@@ -164,6 +222,64 @@ for file in $po ; do |
164 | 222 |
echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
165 | 223 |
fi |
166 | 224 |
|
225 |
+ # If the translation is Polish, include the |
|
226 |
+ # correct header, menu files and footer |
|
227 |
+ if [ $lang = "pl" ] |
|
228 |
+ then |
|
229 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
230 |
+ new_head=`echo $orig_head | sed s@head.wmi@pl/head.wmi@` |
|
231 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
|
232 |
+ |
|
233 |
+ # Side (not all files include this) |
|
234 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
235 |
+ if [ -n "$orig_side" ] |
|
236 |
+ then |
|
237 |
+ new_side=`echo '#include "pl/side.wmi"'` |
|
238 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile" |
|
239 |
+ fi |
|
240 |
+ |
|
241 |
+ # Info (not all files include this) |
|
242 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
243 |
+ if [ -n "$orig_info" ] |
|
244 |
+ then |
|
245 |
+ new_info=`echo '#include "pl/info.wmi"'` |
|
246 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile" |
|
247 |
+ fi |
|
248 |
+ |
|
249 |
+ # Footer |
|
250 |
+ echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
|
251 |
+ fi |
|
252 |
+ |
|
253 |
+ # If the file is an Arabic translation, include the |
|
254 |
+ # correct header, css, menu files and footer |
|
255 |
+ if [ $lang = "ar" ] |
|
256 |
+ then |
|
257 |
+ # Head |
|
258 |
+ orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
259 |
+ temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@` |
|
260 |
+ new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
261 |
+ sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
|
262 |
+ |
|
263 |
+ # Side (not all files include this) |
|
264 |
+ orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
265 |
+ if [ -n "$orig_side" ] |
|
266 |
+ then |
|
267 |
+ new_side=`echo '#include "ar/side.wmi"'` |
|
268 |
+ sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile" |
|
269 |
+ fi |
|
270 |
+ |
|
271 |
+ # Info (not all files include this) |
|
272 |
+ orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
273 |
+ if [ -n "$orig_info" ] |
|
274 |
+ then |
|
275 |
+ new_info=`echo '#include "ar/info.wmi"'` |
|
276 |
+ sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile" |
|
277 |
+ fi |
|
278 |
+ |
|
279 |
+ # Footer |
|
280 |
+ echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile" |
|
281 |
+ fi |
|
282 |
+ |
|
167 | 283 |
# If the directory does not include sidenav.wmi, |
168 | 284 |
# copy it from the English directory (only if |
169 | 285 |
# the English directory has this file) |
... | ... |
@@ -204,76 +320,10 @@ for file in $po ; do |
204 | 320 |
then |
205 | 321 |
subdir="pl" |
206 | 322 |
nosubdir |
207 |
- |
|
208 |
- # If the file was written, include the right |
|
209 |
- # header, menu files and footer |
|
210 |
- if [ -e "$wmldir/$subdir/$wmlfile" ] |
|
211 |
- then |
|
212 |
- # Head |
|
213 |
- orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
214 |
- new_head=`echo $orig_head | sed s@head.wmi@pl/head.wmi@` |
|
215 |
- sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
|
216 |
- |
|
217 |
- # Side (not all files include this) |
|
218 |
- orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
219 |
- if [ -n "$orig_side" ] |
|
220 |
- then |
|
221 |
- new_side=`echo '#include "pl/side.wmi"'` |
|
222 |
- sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
|
223 |
- fi |
|
224 |
- |
|
225 |
- # Info (not all files include this) |
|
226 |
- orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
227 |
- if [ -n "$orig_info" ] |
|
228 |
- then |
|
229 |
- new_info=`echo '#include "pl/info.wmi"'` |
|
230 |
- sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
|
231 |
- fi |
|
232 |
- |
|
233 |
- # Footer |
|
234 |
- echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
|
235 |
- fi |
|
236 |
- fi |
|
237 |
- |
|
238 |
- # If the file is an Arabic translation, include |
|
239 |
- # the right header, css, menu files and footer |
|
240 |
- if [ $subdir = "ar" ] |
|
241 |
- then |
|
242 |
- # Convert the file first |
|
243 |
- nosubdir |
|
244 |
- |
|
245 |
- # If it was written, do the following |
|
246 |
- if [ -e "$wmldir/$subdir/$wmlfile" ] |
|
247 |
- then |
|
248 |
- # Head |
|
249 |
- orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
250 |
- temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@` |
|
251 |
- new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'` |
|
252 |
- sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile" |
|
253 |
- |
|
254 |
- # Side (not all files include this) |
|
255 |
- orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
256 |
- if [ -n "$orig_side" ] |
|
257 |
- then |
|
258 |
- new_side=`echo '#include "ar/side.wmi"'` |
|
259 |
- sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile" |
|
260 |
- fi |
|
261 |
- |
|
262 |
- # Info (not all files include this) |
|
263 |
- orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"` |
|
264 |
- if [ -n "$orig_info" ] |
|
265 |
- then |
|
266 |
- new_info=`echo '#include "ar/info.wmi"'` |
|
267 |
- sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile" |
|
268 |
- fi |
|
269 |
- |
|
270 |
- # Footer |
|
271 |
- echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$wmlfile" |
|
272 |
- fi |
|
273 | 323 |
fi |
274 | 324 |
|
275 | 325 |
# Convert everything else |
276 |
- if [[ $subdir != "en" && $subdir != "zh_CN" && $subdir != "nb" && $subdir != "sv" && $subdir != "ar" ]] |
|
326 |
+ if [[ $subdir != "en" && $subdir != "zh_CN" && $subdir != "nb" && $subdir != "sv" && $subdir != "pl_PL" ]] |
|
277 | 327 |
then |
278 | 328 |
nosubdir |
279 | 329 |
fi |
... | ... |
@@ -304,77 +354,10 @@ for file in $po ; do |
304 | 354 |
then |
305 | 355 |
lang="pl" |
306 | 356 |
subdir |
307 |
- |
|
308 |
- # If the file was written, include the right |
|
309 |
- # header, menu files and footer |
|
310 |
- if [ -e "$wmldir/$subdir/$lang/$wmlfile" ] |
|
311 |
- then |
|
312 |
- # Head |
|
313 |
- orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
314 |
- new_head=`echo $orig_head | sed s@head.wmi@pl/head.wmi@` |
|
315 |
- sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile" |
|
316 |
- |
|
317 |
- # Side (not all files include this) |
|
318 |
- orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
319 |
- if [ -n "$orig_side" ] |
|
320 |
- then |
|
321 |
- new_side=`echo '#include "pl/side.wmi"'` |
|
322 |
- sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile" |
|
323 |
- fi |
|
324 |
- |
|
325 |
- # Info (not all files include this) |
|
326 |
- orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"` |
|
327 |
- if [ -n "$orig_info" ] |
|
328 |
- then |
|
329 |
- new_info=`echo '#include "pl/info.wmi"'` |
|
330 |