Bug 5915 : C4::AuthoritiesMarc AddAuthority
[koha.git] / misc / translator / tmpl_process3.pl
index 8bf92bf..b916cab 100755 (executable)
@@ -12,6 +12,7 @@ using gettext-compatible translation files
 =cut
 
 use strict;
+#use warnings; FIXME - Bug 2505
 use Getopt::Long;
 use Locale::PO;
 use File::Temp qw( :POSIX );
@@ -50,8 +51,9 @@ sub text_replace_tag ($$) {
     # value [tag=input], meta
     my $tag = lc($1) if $t =~ /^<(\S+)/s;
     my $translated_p = 0;
-    for my $a ('alt', 'content', 'title', 'value') {
+    for my $a ('alt', 'content', 'title', 'value','label') {
     if ($attr->{$a}) {
+        next if $a eq 'label' && $tag ne 'optgroup';
         next if $a eq 'content' && $tag ne 'meta';
         next if $a eq 'value' && ($tag ne 'input'
         || (ref $attr->{'type'} && $attr->{'type'}->[1] =~ /^(?:checkbox|hidden|radio|text)$/)); # FIXME
@@ -72,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;
 }
@@ -108,6 +116,8 @@ sub text_replace (**) {
         }
         }
     } elsif (defined $t) {
+        # Quick fix to bug 4472
+        $t = "<!DOCTYPE stylesheet ["  if $t =~ /DOCTYPE stylesheet/ ;
         print $output $t;
     }
     }