Browse code

updated wml2po.sh to handle the js-stuff in download.wml

Runa A. Sandvik authored on05/09/2011 00:05:35
Showing1 changed files
... ...
@@ -162,8 +162,14 @@ for file in $wml ; do
162 162
 	# and the correct copyright.
163 163
 	if [ $poexist = 0 ]
164 164
 	then
165
-		# Convert it
166
-		po4a-gettextize -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
165
+		# Do something special for download.wml and its js
166
+		if [ $wmlfile = "download.wml" ] 
167
+		then
168
+			po4a-gettextize -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault" -o ontagerror="silent"
169
+		else
170
+			# Convert it
171
+			po4a-gettextize -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
172
+		fi
167 173
 
168 174
 		# Check to see if the file exists
169 175
 		if [ -e "$popath/$pofile" ]
... ...
@@ -193,7 +199,12 @@ for file in $wml ; do
193 199
 
194 200
 		# Update the file with po4a-updatepo to make the
195 201
 		# word wrapping perfect
196
-		po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
202
+		if [ $wmlfile = "download.wml" ]
203
+		then
204
+			po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault" -o ontagerror="silent"
205
+		else
206
+			po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
207
+		fi
197 208
 
198 209
 		# Delete the backup
199 210
 		rm -f "$popath/$pofile~"
... ...
@@ -207,7 +218,12 @@ for file in $wml ; do
207 218
 		before=`grep -vE '^("POT-Creation-Date:|#)' "$popath/$pofile" | md5sum | cut -d " " -f1`
208 219
 
209 220
 		# Update the pot file
210
-		po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
221
+		if [ $wmlfile = "download.wml" ]
222
+		then
223
+			po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault" -o ontagerror="silent"
224
+		else
225
+			po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
226
+		fi
211 227
 
212 228
 		# Calculate the new hash
213 229
 		after=`grep -vE '^("POT-Creation-Date:|#)' "$popath/$pofile" | md5sum | cut -d " " -f1`
... ...
@@ -234,7 +250,12 @@ for file in $wml ; do
234 250
 	if [ $poexist = 2 ]
235 251
 	then
236 252
 		# Update the file
237
-		po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
253
+		if [ $wmlfile = "download.wml" ]
254
+		then
255
+			po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault" -o ontagerror="silent"
256
+		else
257
+			po4a-updatepo -f wml -m "$file" -p "$popath/$pofile" --master-charset utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
258
+		fi
238 259
 	fi
239 260
 	
240 261
 	# Write to the logfile