do not keep old translations
Runa A. Sandvik

Runa A. Sandvik commited on 2010-08-18 21:27:29
Zeige 1 geänderte Dateien mit 6 Einfügungen und 9 Löschungen.

... ...
@@ -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
 
... ...
@@ -113,18 +111,17 @@ for file in $po ; do
113 111
 	}	
114 112
 
115 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
 
131 128