Browse code

update po2wml to make things work

Runa A. Sandvik authored on 31/03/2011 13:17:24
Showing 1 changed files
... ...
@@ -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
-					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile"
331
-				fi
332
-
333
-				# Footer
334
-				echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
335
-			fi
336
-
337
-		fi
338
-
339
-		# If the file is an Arabic translation, include the
340
-		# right header, css, menu files and footer
341
-		if [ $lang = "ar" ]
342
-		then
343
-			# Convert the file first
344
-			subdir
345
-
346
-			# If it was written, do the following
347
-			if [ -e "$wmldir/$subdir/$lang/$wmlfile" ]
348
-			then
349
-				# Head
350
-				orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
351
-				temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@`
352
-				new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'`
353
-				sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile"
354
-
355
-				# Side (not all files include this)
356
-				orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
357
-				if [ -n "$orig_side" ]
358
-				then
359
-					new_side=`echo '#include "ar/side.wmi"'`
360
-					sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile"
361
-				fi
362
-
363
-				# Info (not all files include this)
364
-				orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
365
-				if [ -n "$orig_info" ]
366
-				then
367
-					new_info=`echo '#include "ar/info.wmi"'`
368
-					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile"
369
-				fi
370
-
371
-				# Footer
372
-				echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
373
-			fi
374 357
 		fi
375 358
 
376 359
 		# Convert everything else
377
-		if [[ $lang != "en" && $lang != "zh_CN" && $lang != "nb" && $lang != "sv" && $lang != "ar" ]]
360
+		if [[ $lang != "en" && $lang != "zh_CN" && $lang != "nb" && $lang != "sv" && $lang != "pl_PL" ]]
378 361
 		then
379 362
 			subdir
380 363
 		fi