Browse code

update script to include various .wmi files for fa translations

Runa A. Sandvik authored on30/08/2011 10:43:39
Showing1 changed files
... ...
@@ -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)