Browse code

make sure arabic translations include the correct files

Runa A. Sandvik authored on17/03/2011 13:31:41
Showing1 changed files
... ...
@@ -105,9 +105,6 @@ for file in $po ; do
105 105
                         # Remove last three lines in file
106 106
 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$wmlfile"
107 107
 
108
-			# Include foot.wmi
109
-			echo "#include <foot.wmi>" >> "$wmldir/$subdir/$wmlfile"
110
-
111 108
 			# If the file is mirrors.wml, include mirrors-table.wmi
112 109
 			if [ $wmlfile == "mirrors.wml" ]
113 110
 			then
... ...
@@ -115,13 +112,37 @@ for file in $po ; do
115 112
 				sed -i 's/PO4ASHARPEND-->//' "$wmldir/$subdir/$wmlfile"
116 113
 			fi
117 114
 
118
-			# If the file is an Arabic translation, make
119
-			# sure it is using the right CSS
115
+			# If the file is an Arabic translation, include
116
+			# the right header, css, menu files and footer
120 117
 			if [ $subdir = "ar" ]
121 118
 			then
122
-				orig_include=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"`
123
-				new_include=`echo $orig_include 'STYLESHEET="css/master-rtl.css"'`
124
-				sed -i "s@$orig_include@$new_include@" "$wmldir/$subdir/$wmlfile"
119
+				# Head
120
+				orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"`
121
+				temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@`
122
+				new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'`
123
+				sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile"
124
+
125
+				# Side (not all files include this)
126
+				orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"`
127
+				if [ -n "$orig_side" ]
128
+				then
129
+					new_side=`echo '#include "ar/side.wmi"'`
130
+					sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile"
131
+				fi
132
+
133
+				# Info (not all files include this)
134
+				orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"`
135
+				if [ -n "$orig_info" ]
136
+				then
137
+					new_info=`echo '#include "ar/info.wmi"'`
138
+					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile"
139
+				fi
140
+
141
+				# Footer
142
+				echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$wmlfile"
143
+			else
144
+				# Include the English footer
145
+				echo '#include "foot.wmi"' >> "$wmldir/$subdir/$wmlfile"
125 146
 			fi
126 147
 		fi
127 148
 	}	
... ...
@@ -141,16 +162,37 @@ for file in $po ; do
141 162
 			# Remove last three lines in file
142 163
 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$lang/$wmlfile"
143 164
 
144
-			# Include foot.wmi
145
-			echo "#include <foot.wmi>" >> "$wmldir/$subdir/$lang/$wmlfile"
146
-
147
-			# If the file is an Arabic translation, make
148
-			# sure it is using the right CSS
165
+			# If the file is an Arabic translation, include the
166
+			# right header, css, menu files and footer
149 167
 			if [ $lang = "ar" ]
150 168
 			then
151
-				orig_include=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
152
-				new_include=`echo $orig_include 'STYLESHEET="css/master-rtl.css"'`
153
-				sed -i "s@$orig_include@$new_include@" "$wmldir/$subdir/$lang/$wmlfile"
169
+				# Head
170
+				orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
171
+				temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@`
172
+				new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'`
173
+				sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile"
174
+
175
+				# Side (not all files include this)
176
+				orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
177
+				if [ -n "$orig_side" ]
178
+				then
179
+					new_side=`echo '#include "ar/side.wmi"'`
180
+					sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile"
181
+				fi
182
+
183
+				# Info (not all files include this)
184
+				orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
185
+				if [ -n "$orig_info" ]
186
+				then
187
+					new_info=`echo '#include "ar/info.wmi"'`
188
+					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile"
189
+				fi
190
+
191
+				# Footer
192
+				echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
193
+			else
194
+				# Include the English footer
195
+				echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
154 196
 			fi
155 197
 		fi
156 198
 	}