Adding optgroup labels to translations rel_3_0_5
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Sun, 13 Dec 2009 18:20:39 +0000 (19:20 +0100)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Sun, 13 Dec 2009 22:39:44 +0000 (23:39 +0100)
misc/translator/tmpl_process3.pl
misc/translator/xgettext.pl

index 8bf92bf..80325d0 100755 (executable)
@@ -50,8 +50,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
index 8e1dfd7..031f9ba 100755 (executable)
@@ -98,8 +98,9 @@ sub text_extract (*) {
        } elsif ($kind eq TmplTokenType::TAG && %$attr) {
            # value [tag=input], meta
            my $tag = lc($1) if $t =~ /^<(\S+)/s;
-           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] =~ /^(?:hidden|radio|checkbox)$/)); # FIXME