Browse code

do not keep old translations

Runa A. Sandvik authored on18/08/2010 21:27:29
Showing1 changed files
... ...
@@ -96,14 +96,12 @@ for file in $po ; do
96 96
 		# The location of the english wml file
97 97
 		english="$wmldir/en/$wmlfile"
98 98
 
99
-		# Convert the files
100
-		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"
99
+		# Convert the translated file. Note that po4a will write the file and then delete it if less than 80% has been translated
100
+		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"
101 101
 
102 102
 		# Check to see if the file was written
103
-                if [ -e "$wmldir/$subdir/tmp-$wmlfile" ]
103
+                if [ -e "$wmldir/$subdir/$wmlfile" ]
104 104
 		then
105
-			mv "$wmldir/$subdir/tmp-$wmlfile" "$wmldir/$subdir/$wmlfile"
106
-
107 105
                         # Remove last three lines in file
108 106
 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$wmlfile"
109 107
 
... ...
@@ -112,19 +110,18 @@ for file in $po ; do
112 110
 		fi
113 111
 	}	
114 112
 
115
-	# Convert translations to directories such as website/torbrowser/nb/.	
113
+	# Convert translations to directories such as website/torbrowser/nb/.
114
+	# Again, po4a will write the file and then delete it if less than 80% has been translated
116 115
 	function subdir {
117 116
 		# The location of the english wml file
118 117
                 english="$wmldir/$subdir/en/$wmlfile"
119 118
 
120 119
 		# Convert the files
121
-		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"
120
+		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"
122 121
 
123 122
 		# Check to see if the file was written
124
-		if [ -e "$wmldir/$subdir/$lang/tmp-$wmlfile" ]
123
+		if [ -e "$wmldir/$subdir/$lang/$wmlfile" ]
125 124
 		then
126
-			mv "$wmldir/$subdir/$lang/tmp-$wmlfile" "$wmldir/$subdir/$lang/$wmlfile"
127
-
128 125
 			# Remove last three lines in file
129 126
 			sed -i -e :a -e '$d;N;2,3ba' -e 'P;D' "$wmldir/$subdir/$lang/$wmlfile"
130 127