88c9eaf0c584252b2309eb16b949930b0f7475ab
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

1) #!/bin/bash
2) #
3) # Author: Runa Sandvik, <runa.sandvik@gmail.com>
4) # Google Summer of Code 2009
5) # 
6) # This is Free Software (GPLv3)
7) # http://www.gnu.org/licenses/gpl-3.0.txt
8) #
9) # This script will convert all the translated po files back to wml
10) # files.
11) #
12) # For more information, see the HOWTO and README in
13) # translation/tools/gsoc09.
14) #
15) 
16) ### start config ###
17) 
18) # Location of the wml files
19) wmldir="$PWD"
20) 
21) # Location of the po files,
Runa A. Sandvik updated scripts with new path

Runa A. Sandvik authored 13 years ago

22) podir="`dirname $wmldir`/translation/projects/website/po"
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

23) 
24) # A lot of the wml files have custom tags. These tags have been defined
25) # in website/include/versions.wmi. Tags that people usually forget to close,
26) # as well as tags that are not defined in versions.wmi have been added.
27) # See: https://svn.torproject.org/svn/website/trunk/include/versions.wmi
Steven Murdoch Add a link tag for svnproje...

Steven Murdoch authored 14 years ago

28) customtag=`echo $(cat "$wmldir/include/versions.wmi" | awk '{ printf "<%s> " , $2 }' | sed 's/<>//g') "<svnsandbox> <svnwebsite> <svnprojects> <input> <hr> <br> <img> <gitblob>"`
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

29) 
30) # We also need to use the nodefault option of po4a; space separated list
31) # of tags that the module should not try to set by default in any
32) # category. For now, we only need the input tag.
33) nodefault='<input>'
34) 
35) ### end config ###
36) 
37) # Create a lockfile to make sure that only one instance of the script
38) # can run at any time.
39) LOCKFILE=po2wml.lock
40) 
41) if lockfile -! -l 60 -r 3 "$LOCKFILE"; 
42) then
43) 	echo "unable to acquire lock" >2
44) 	exit 1
45) fi
46) 
47) trap "rm -f '$PWD/$LOCKFILE'" exit
48) 
49) # Check if translation/projects/website exist, i.e. has been checked out
50) if [ ! -d $podir ]
51) then
52) 	echo "Have you remembered to check out translation/projects/website?"
53) 	exit 1
54) fi
55) 
56) # cd to the right directory so we can commit the files later
57) cd "$wmldir"
58) 
59) # We need to find the po files
60) po=`find $podir -regex '^'$podir'/.*/.*\.po' -type f`
61) 
62) # For every wml, update po
63) for file in $po ; do
Runa A. Sandvik call validate.py before con...

Runa A. Sandvik authored 13 years ago

64) 
65) 	# Validate input and write results to a log file
66) 	validate_script="`dirname $wmldir`/translation/tools/validate.py"
Runa A. Sandvik updated script and new tran...

Runa A. Sandvik authored 13 years ago

67) 	validate_log="`dirname $wmldir`/validate/website-validate.log"
Runa A. Sandvik call validate.py before con...

Runa A. Sandvik authored 13 years ago

68) 	python "$validate_script" -i "$file" -l	"$validate_log"
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

69) 	
70) 	# Get the basename of the file we are dealing with
71) 	pofile=`basename $file`
72) 
73) 	# Strip the file for its original extension and the translation
74) 	# priority, and add .wml
75) 	wmlfile="`echo $pofile | cut -d . -f 2`.wml"	
76) 
77) 	# Find out what directory the file is in.
78) 	indir=`dirname $file`
79) 
80) 	# We also need to know what one directory up is
81) 	onedirup=`dirname $indir`
82) 
83) 	# We need to find out what subdirectory we are in
84) 	subdir=`dirname $file | sed "s#$onedirup/##"`
85) 
86) 	# And which language we are dealing with
87) 	lang=`dirname $indir | sed "s#$podir/##"`
88) 
89) 	# Time to write the translated wml file.
90) 	# The translated document is written if 80% or more of the po
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

91) 	# file has been translated. Example: Use '-k 21' to set this
92) 	# number down to 21%. Also, po4a-translate will only write the
93) 	# translated document if 80% or more has been translated.
94) 	# However, it will delete the wml if less than 80% has been
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

95) 	# translated. To avoid having our current, translated wml files
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

96) 	# deleted, convert the po to a temp wml first. If this file was
97) 	# actually written, rename it to wml.
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

98) 
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

99) 	# Convert translations to directories such as website/nb/.
100) 	function nosubdir {
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

101) 		# The location of the english wml file
102) 		english="$wmldir/en/$wmlfile"
103) 
Runa A. Sandvik do not keep old translations

Runa A. Sandvik authored 13 years ago

104) 		# Convert the translated file. Note that po4a will write the file and then delete it if less than 80% has been translated
105) 		po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

106) 
107) 		# Check to see if the file was written
Runa A. Sandvik do not keep old translations

Runa A. Sandvik authored 13 years ago

108)                 if [ -e "$wmldir/$subdir/$wmlfile" ]
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

109) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

110)                         # Remove last three lines in file
111) 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$wmlfile"
112) 
Runa A. Sandvik automatically fix mirrors.w...

Runa A. Sandvik authored 13 years ago

113) 			# If the file is mirrors.wml, include mirrors-table.wmi
114) 			if [ $wmlfile == "mirrors.wml" ]
115) 			then
116) 				sed -i 's/<!--PO4ASHARPBEGIN/#/' "$wmldir/$subdir/$wmlfile"
117) 				sed -i 's/PO4ASHARPEND-->//' "$wmldir/$subdir/$wmlfile"
118) 			fi
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

119) 
Runa A. Sandvik update po2wml to include Po...

Runa A. Sandvik authored 13 years ago

120) 			# Include the English footer for most of the
121) 			# translations
Runa A. Sandvik make sure we include the Ge...

Runa A. Sandvik authored 13 years ago

122) 			if [[ $subdir != "ar" && $subdir != "pl" && $subdir != "de" ]]
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

123) 			then
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

124) 				echo '#include "foot.wmi"' >> "$wmldir/$subdir/$wmlfile"
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

125) 			fi
Runa A. Sandvik update po2wml to include Po...

Runa A. Sandvik authored 13 years ago

126) 
Runa A. Sandvik update po2wml to make thing...

Runa A. Sandvik authored 13 years ago

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) 
Runa A. Sandvik make sure we include the Ge...

Runa A. Sandvik authored 13 years ago

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) 
Runa A. Sandvik update po2wml to make thing...

Runa A. Sandvik authored 13 years ago

185) 			# If the translation is Arabic, include the
186) 			# correct header, css, menu files and footer
187) 			if [ $subdir = "ar" ]
188) 			then
189) 				# Head
190) 				orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$wmlfile"`
191) 				temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@`
192) 				new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'`
193) 				sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$wmlfile"
194) 
195) 				# Side (not all files include this)
196) 				orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$wmlfile"`
197) 				if [ -n "$orig_side" ]
198) 				then
199) 					new_side=`echo '#include "ar/side.wmi"'`
200) 					sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$wmlfile"
201) 				fi
202) 
203) 				# Info (not all files include this)
204) 				orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$wmlfile"`
205) 				if [ -n "$orig_info" ]
206) 				then
207) 					new_info=`echo '#include "ar/info.wmi"'`
208) 					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$wmlfile"
209) 				fi
210) 
211) 				# Footer
212) 				echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$wmlfile"
213) 			fi
214) 
Runa A. Sandvik update po2wml to include Po...

Runa A. Sandvik authored 13 years ago

215) 			# If the directory does not include sidenav.wmi,
216) 			# copy it from the English directory (only if
217) 			# the English directory has this file)
218) 			if [[ ! -e "$wmldir/$subdir/sidenav.wmi" && -e "$wmldir/en/sidenav.wmi" ]]
219) 			then
220) 				cp "$wmldir/en/sidenav.wmi" "$wmldir/$subdir"
221) 			fi
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

222) 		fi
223) 	}	
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

224) 
Runa A. Sandvik do not keep old translations

Runa A. Sandvik authored 13 years ago

225) 	# Convert translations to directories such as website/torbrowser/nb/.
226) 	# Again, po4a will write the file and then delete it if less than 80% has been translated
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

227) 	function subdir {
228) 		# The location of the english wml file
229)                 english="$wmldir/$subdir/en/$wmlfile"
Runa A. Sandvik remove last three lines of...

Runa A. Sandvik authored 14 years ago

230) 
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

231) 		# Convert the files
Runa A. Sandvik do not keep old translations

Runa A. Sandvik authored 13 years ago

232) 		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"
Runa A. Sandvik remove last three lines of...

Runa A. Sandvik authored 14 years ago

233) 
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

234) 		# Check to see if the file was written
Runa A. Sandvik do not keep old translations

Runa A. Sandvik authored 13 years ago

235) 		if [ -e "$wmldir/$subdir/$lang/$wmlfile" ]
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

236) 		then
237) 			# Remove last three lines in file
238) 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$lang/$wmlfile"
239) 
Runa A. Sandvik updated translations for th...

Runa A. Sandvik authored 13 years ago

240) 			# Remove a specific comment from a specific file
241) 			if [ $wmlfile == "download-easy.wml" ]			
242) 			then
243) 				translator_comment="# Translators: please point to the version of TBB in your language, if there is one."
244) 				sed -i "s/$translator_comment//" "$wmldir/$subdir/$lang/$wmlfile"
245) 			fi
Runa A. Sandvik remove translator comments...

Runa A. Sandvik authored 13 years ago

246) 
Runa A. Sandvik update po2wml to include Po...

Runa A. Sandvik authored 13 years ago

247) 			# Include the English footer for most of the
248) 			# translations 
Runa A. Sandvik we do not need two footers...

Runa A. Sandvik authored 13 years ago

249) 			if [[ $lang != "ar" && $lang != "pl" && $lang != "de" ]]
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

250) 			then
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

251) 				echo '#include "foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
Runa A. Sandvik make sure arabic translatio...

Runa A. Sandvik authored 13 years ago

252) 			fi
Runa A. Sandvik update po2wml to include Po...

Runa A. Sandvik authored 13 years ago

253) 
Runa A. Sandvik updated the script to inclu...

Runa A. Sandvik authored 12 years ago

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) 
Runa A. Sandvik update po2wml to make thing...

Runa A. Sandvik authored 13 years ago

265)                         # If the translation is Polish, include the
266)                         # correct header, menu files and footer
267) 			if [ $lang = "pl" ]
268) 			then
269) 				orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
270) 				new_head=`echo $orig_head | sed s@head.wmi@pl/head.wmi@`
271) 				sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile"
272) 
273) 				# Side (not all files include this)
274) 				orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
275) 				if [ -n "$orig_side" ]
276) 				then
277) 					new_side=`echo '#include "pl/side.wmi"'`
278) 					sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile"
279) 				fi
280) 
281) 				# Info (not all files include this)
282) 				orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
283) 				if [ -n "$orig_info" ]
284) 				then
285) 					new_info=`echo '#include "pl/info.wmi"'`
286) 					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile"
287) 				fi
288) 
289) 				# Footer
290) 				echo '#include "pl/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
291) 			fi
292) 
Runa A. Sandvik make sure we include the Ge...

Runa A. Sandvik authored 13 years ago

293)                         # If the translation is German, include the
294)                         # correct header, menu files and footer
295)                         if [ $lang = "de" ]
296)                         then
297)                                 orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
298)                                 new_head=`echo $orig_head | sed s@head.wmi@de/head.wmi@`
299)                                 sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile"
300) 
301)                                 # Side (not all files include this)
302)                                 orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
303)                                 if [ -n "$orig_side" ]
304)                                 then
305)                                         new_side=`echo '#include "de/side.wmi"'`
306)                                         sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile"
307)                                 fi
308) 
309)                                 # Info (not all files include this)
310)                                 orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
311)                                 if [ -n "$orig_info" ]
312)                                 then
313)                                         new_info=`echo '#include "de/info.wmi"'`
314)                                         sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile"
315)                                 fi
316) 
317)                                 # Footer
318)                                 echo '#include "de/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
Runa A. Sandvik get the po2wml script ready...

Runa A. Sandvik authored 12 years ago

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
Runa A. Sandvik make sure we include the Ge...

Runa A. Sandvik authored 13 years ago

326)                         fi
327) 
Runa A. Sandvik update po2wml to make thing...

Runa A. Sandvik authored 13 years ago

328) 			# If the file is an Arabic translation, include the
329) 			# correct header, css, menu files and footer
330) 			if [ $lang = "ar" ]
331) 			then
332) 				# Head
333) 				orig_head=`grep '#include "head.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
334) 				temp_head=`echo $orig_head | sed s@head.wmi@ar/head.wmi@`
335) 				new_head=`echo $temp_head 'STYLESHEET="css/master-rtl.css"'`
336) 				sed -i "s@$orig_head@$new_head@" "$wmldir/$subdir/$lang/$wmlfile"
337) 
338) 				# Side (not all files include this)
339) 				orig_side=`grep '#include "side.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
340) 				if [ -n "$orig_side" ]
341) 				then
342) 					new_side=`echo '#include "ar/side.wmi"'`
343) 					sed -i "s@$orig_side@$new_side@" "$wmldir/$subdir/$lang/$wmlfile"
344) 				fi
345) 
346) 				# Info (not all files include this)
347) 				orig_info=`grep '#include "info.wmi"' "$wmldir/$subdir/$lang/$wmlfile"`
348) 				if [ -n "$orig_info" ]
349) 				then
350) 					new_info=`echo '#include "ar/info.wmi"'`
351) 					sed -i "s@$orig_info@$new_info@" "$wmldir/$subdir/$lang/$wmlfile"
352) 				fi
353) 
354) 				# Footer
355) 				echo '#include "ar/foot.wmi"' >> "$wmldir/$subdir/$lang/$wmlfile"
356) 			fi
357) 
Runa A. Sandvik update po2wml to include Po...

Runa A. Sandvik authored 13 years ago

358) 			# If the directory does not include sidenav.wmi,
359) 			# copy it from the English directory (only if 
360) 			# the English directory has this file)
361) 			if [[ ! -e "$wmldir/$subdir/$lang/sidenav.wmi" && -e "$wmldir/$subdir/en/sidenav.wmi" ]]
362) 			then
363) 				cp "$wmldir/$subdir/en/sidenav.wmi" "$wmldir/$subdir/$lang/"
364) 			fi
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

365) 		fi
366) 	}
367) 
368) 	# If $onedirup is equal to $lang, that means we do not have a
369) 	# subdirectory.
370) 	if [ $onedirup == $lang ]
371) 	then
372) 		# If the current subdirectory is "zh_CN" use "zh-cn" instead
373) 		if [ $subdir = "zh_CN" ]
374) 		then
375) 			subdir="zh-cn"
376) 			nosubdir
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

377) 		fi
378) 		
Runa A. Sandvik quick fix for nb and sv

Runa A. Sandvik authored 14 years ago

379) 		# If the current directory is "nb" use "no" instead
380) 		if [ $subdir = "nb" ]
381) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

382) 			subdir="no"
383) 			nosubdir
Runa A. Sandvik quick fix for nb and sv

Runa A. Sandvik authored 14 years ago

384) 		fi
385) 
386) 		# If the current directory is "sv" use "se" instead
387) 		if [ $subdir = "sv" ]
388) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

389) 			subdir="se"
390) 			nosubdir
Runa A. Sandvik quick fix for nb and sv

Runa A. Sandvik authored 14 years ago

391) 		fi
392) 
Runa A. Sandvik we want to use pl instead o...

Runa A. Sandvik authored 13 years ago

393) 		# If the current directory is "pl_PL" use "pl" instead
394) 		if [ $subdir = "pl_PL" ]
395) 		then
396) 			subdir="pl"
397) 			nosubdir
398) 		fi
399) 
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

400) 		# Convert everything else
Runa A. Sandvik update po2wml to make thing...

Runa A. Sandvik authored 13 years ago

401) 		if [[ $subdir != "en" && $subdir != "zh_CN" && $subdir != "nb" && $subdir != "sv" && $subdir != "pl_PL" ]]
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

402) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

403) 			nosubdir
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

404) 		fi
405) 	else
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

406) 		# If the current language is "zh_CN" use "zh-cn" instead
407) 		if [ $lang = "zh_CN" ]
408) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

409) 			lang="zh-cn"
410) 			subdir
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

411) 		fi
Runa A. Sandvik quick fix for nb and sv

Runa A. Sandvik authored 14 years ago

412) 
413) 		# If the current language is "nb" use "no" instead
414) 		if [ $lang = "nb" ]
415) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

416) 			lang="no"
417) 			subdir
Runa A. Sandvik quick fix for nb and sv

Runa A. Sandvik authored 14 years ago

418) 		fi
419) 
420) 		# If the current language is "sv" use "se" instead
421) 		if [ $lang = "sv" ]
422) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

423) 			lang="se"
424) 			subdir
Runa A. Sandvik quick fix for nb and sv

Runa A. Sandvik authored 14 years ago

425) 		fi
Runa A. Sandvik we want to use pl instead o...

Runa A. Sandvik authored 13 years ago

426) 	
427) 		# If the current language is "pl_PL" use "pl" instead
428) 		if [ $lang = "pl_PL" ]
429) 		then
430) 			lang="pl"
431) 			subdir
432) 		fi
433) 
Runa A. Sandvik if the directory is zh_CN w...

Runa A. Sandvik authored 14 years ago

434) 		# Convert everything else
Runa A. Sandvik update po2wml to make thing...

Runa A. Sandvik authored 13 years ago

435) 		if [[ $lang != "en" && $lang != "zh_CN" && $lang != "nb" && $lang != "sv" && $lang != "pl_PL" ]]
Runa A. Sandvik put the scripts in website

Runa A. Sandvik authored 14 years ago

436) 		then
Runa A. Sandvik because functions are nice

Runa A. Sandvik authored 13 years ago

437) 			subdir