[or-cvs] r22967: {website} do not keep old translations (website/trunk)

Runa Sandvik runa.sandvik at gmail.com
Wed Aug 18 19:27:29 UTC 2010


Author: runa
Date: 2010-08-18 19:27:29 +0000 (Wed, 18 Aug 2010)
New Revision: 22967

Modified:
   website/trunk/po2wml.sh
Log:
do not keep old translations

Modified: website/trunk/po2wml.sh
===================================================================
--- website/trunk/po2wml.sh	2010-08-18 19:15:21 UTC (rev 22966)
+++ website/trunk/po2wml.sh	2010-08-18 19:27:29 UTC (rev 22967)
@@ -96,14 +96,12 @@
 		# The location of the english wml file
 		english="$wmldir/en/$wmlfile"
 
-		# Convert the files
-		po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/tmp-$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
+		# Convert the translated file. Note that po4a will write the file and then delete it if less than 80% has been translated
+		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"
 
 		# Check to see if the file was written
-                if [ -e "$wmldir/$subdir/tmp-$wmlfile" ]
+                if [ -e "$wmldir/$subdir/$wmlfile" ]
 		then
-			mv "$wmldir/$subdir/tmp-$wmlfile" "$wmldir/$subdir/$wmlfile"
-
                         # Remove last three lines in file
 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$wmlfile"
 
@@ -112,19 +110,18 @@
 		fi
 	}	
 
-	# Convert translations to directories such as website/torbrowser/nb/.	
+	# Convert translations to directories such as website/torbrowser/nb/.
+	# Again, po4a will write the file and then delete it if less than 80% has been translated
 	function subdir {
 		# The location of the english wml file
                 english="$wmldir/$subdir/en/$wmlfile"
 
 		# Convert the files
-		po4a-translate -f wml -m "$english" -p "$file" -l "$wmldir/$subdir/$lang/tmp-$wmlfile" --master-charset utf-8 -L utf-8 -o customtag="$customtag" -o nodefault="$nodefault"
+		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"
 
 		# Check to see if the file was written
-		if [ -e "$wmldir/$subdir/$lang/tmp-$wmlfile" ]
+		if [ -e "$wmldir/$subdir/$lang/$wmlfile" ]
 		then
-			mv "$wmldir/$subdir/$lang/tmp-$wmlfile" "$wmldir/$subdir/$lang/$wmlfile"
-
 			# Remove last three lines in file
 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$lang/$wmlfile"
 



More information about the tor-commits mailing list