Merge remote branch 'kc/master' into new/enh/bug_5917
[koha_gimpoz] / misc / translator / tmpl_process3.pl
index dbbe18e..dd6cf5c 100755 (executable)
@@ -74,10 +74,16 @@ sub text_replace_tag ($$) {
             sprintf(' %s=%s', $_, $attr->{$_}->[2]) #FIXME
         } sort {
             $attr->{$a}->[3] <=> $attr->{$b}->[3] #FIXME
-        } keys %$attr)
-        . '>';
-    } else {
-    $it = $t;
+        } keys %$attr);
+       if ($tag eq 'img'){
+           $it .= ' />';
+       }
+       else {      
+           $it .= ' >';
+       }
+    } 
+    else {
+        $it = $t;
     }
     return $it;
 }
@@ -110,6 +116,8 @@ sub text_replace (**) {
         }
         }
     } elsif (defined $t) {
+        # Quick fix to bug 4472
+        $t = "<!DOCTYPE stylesheet ["  if $t =~ /DOCTYPE stylesheet/ ;
         print $output $t;
     }
     }
@@ -219,8 +227,8 @@ my $action = shift or usage_error('You must specify an ACTION.');
 usage_error('You must at least specify input and string list filenames.')
     if !@in_files || !defined $str_file;
 
-# Type match defaults to *.tmpl plus *.inc if not specified
-$type = "tmpl|inc|xsl" if !defined($type);
+# Type match defaults to *.tt plus *.inc if not specified
+$type = "tt|inc|xsl" if !defined($type);
 
 # Check the inputs for being files or directories
 for my $input (@in_files) {