Index: trunk/package/bin/po4a/po4a-normalize =================================================================== --- trunk/package/bin/po4a/po4a-normalize (revision 2379) +++ trunk/package/bin/po4a/po4a-normalize (revision 2380) @@ -178,3 +178,4 @@ $parser->writepo('po4a-normalize.po'); __END__ + Index: trunk/package/bin/po4a/po4a-updatepo =================================================================== --- trunk/package/bin/po4a/po4a-updatepo (revision 2379) +++ trunk/package/bin/po4a/po4a-updatepo (revision 2380) @@ -103,6 +103,21 @@ Output some debugging information. +=item B I[,B|B] + +Specify the reference format. Argument I can be one of B to not +produce any reference, B to not specify the line number (more +accurately all line numbers are replaced by 1), B to replace line +number by an increasing counter, and B to include complete +references. + +Argument can be followed by a comma and either B or B keyword. +References are written by default on a single line. The B option wraps +references on several lines, to mimic B tools (B and +B). This option will become the default in a future release, because +it is more sensible. The B option is available so that users who want +to keep the old behavior can do so. + =item B<--msgid-bugs-address> I Set the report address for msgid bugs. By default, the created POT files Index: trunk/package/bin/po4a/lib/Locale/Po4a/Man.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/Man.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/Man.pm (revision 2380) @@ -2407,6 +2407,8 @@ $macro{'Ss'}=\&translate_mdoc; # .Pp Paragraph Break. Vertical space (one line). $macro{'Pp'}=\&noarg; + # .Lp Same as .Pp + $macro{'Lp'}=\&noarg; # .D1 (D-one) Display-one Indent and display one text line. $macro{'D1'}=\&translate_mdoc; # .Dl (D-ell) Display-one literal. @@ -2427,6 +2429,8 @@ # FIXME: Maybe we could extract other modifiers # as in .It Fl l Ar num $macro{'It'}=\&translate_mdoc; + # .Lk html link + $macro{'Lk'}=\&untranslated; # Manual Domain Macros # ==================== @@ -2440,8 +2444,8 @@ # General Text Domain # =================== - foreach (qw(%A %B %C %D %J %N %O %P %R %T %V - Ac Ao Ap Aq At Bc Bf Bo Bq Bx Db Dc Do Dq Ec Ef Em Eo Fx No Ns + foreach (qw(%A %B %C %D %I %J %N %O %P %Q %R %T %U %V + Ac Ao Ap Aq At Bc Bf Bo Bq Brc Bro Brq Bx Db Dc Do Dq Ec Ef Em Eo Eq Fx No Ns Pc Pf Po Pq Qc Ql Qo Qq Re Rs Rv Sc So Sq Sm Sx Sy Tn Ux Xc Xo)) { $inline{$_} = 1; } Index: trunk/package/bin/po4a/lib/Locale/Po4a/Po.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/Po.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/Po.pm (revision 2380) @@ -51,12 +51,39 @@ =over 4 -=item B +=item B I[,B|B] -This specifies the reference format. It can be one of B to not produce -any reference, B to not specify the line number, and B to -include complete references. +Specify the reference format. Argument I can be one of B to not +produce any reference, B to not specify the line number (more +accurately all line numbers are replaced by 1), B to replace line +number by an increasing counter, and B to include complete +references. +Argument can be followed by a comma and either B or B keyword. +References are written by default on a single line. The B option wraps +references on several lines, to mimic B tools (B and +B). This option will become the default in a future release, because +it is more sensible. The B option is available so that users who want +to keep the old behavior can do so. + +=item B<--msgid-bugs-address> I + +Set the report address for msgid bugs. By default, the created POT files +have no Report-Msgid-Bugs-To fields. + +=item B<--copyright-holder> I + +Set the copyright holder in the POT header. The default value is +"Free Software Foundation, Inc." + +=item B<--package-name> I + +Set the package name for the POT header. The default is "PACKAGE". + +=item B<--package-version> I + +Set the package version for the POT header. The default is "VERSION". + =back =cut @@ -150,7 +177,7 @@ chomp $date; # $options = ref($options) || $options; - $self->{options}{'porefs'}= 'full'; + $self->{options}{'porefs'}= 'full,nowrap'; $self->{options}{'msgid-bugs-address'}= undef; $self->{options}{'copyright-holder'}= "Free Software Foundation, Inc."; $self->{options}{'package-name'}= "PACKAGE"; @@ -163,12 +190,15 @@ $self->{options}{$opt} = $options->{$opt}; } } - $self->{options}{'porefs'} =~ /^(full|noline|none)$/ || + $self->{options}{'porefs'} =~ /^(full|counter|noline|none)(,(no)?wrap)?$/ || die wrap_mod("po4a::po", dgettext ("po4a", "Invalid value for option 'porefs' ('%s' is ". - "not one of 'full', 'noline' or 'none')"), + "not one of 'full', 'counter', 'noline' or 'none')"), $self->{options}{'porefs'}); + if ($self->{options}{'porefs'} =~ m/^counter/) { + $self->{counter} = {}; + } $self->{po}=(); $self->{count}=0; # number of msgids in the PO @@ -429,9 +459,15 @@ $output .= format_comment($self->{po}{$msgid}{'type'},". type: ") if defined($self->{po}{$msgid}{'type'}) && length ($self->{po}{$msgid}{'type'}); - $output .= format_comment($self->{po}{$msgid}{'reference'},": ") - if defined($self->{po}{$msgid}{'reference'}) - && length ($self->{po}{$msgid}{'reference'}); + if ( defined($self->{po}{$msgid}{'reference'}) + && length ($self->{po}{$msgid}{'reference'})) { + my $output_ref = $self->{po}{$msgid}{'reference'}; + if ($self->{options}{'porefs'} =~ m/,wrap$/) { + $output_ref = wrap($output_ref); + $output_ref =~ s/\s+$//mg; + } + $output .= format_comment($output_ref,": "); + } $output .= "#, ". join(", ", sort split(/\s+/,$self->{po}{$msgid}{'flags'}))."\n" if defined($self->{po}{$msgid}{'flags'}) && length ($self->{po}{$msgid}{'flags'}); @@ -1221,10 +1257,23 @@ return; } - if ($self->{options}{'porefs'} eq "none") { + if ($self->{options}{'porefs'} =~ m/^none/) { $reference = ""; - } elsif ($self->{options}{'porefs'} eq "noline") { - $reference =~ s/:[0-9]*/:1/g; + } elsif ($self->{options}{'porefs'} =~ m/^counter/) { + if ($reference =~ m/^(.+?)(?=\S+:\d+)/g) { + my $new_ref = $1; + 1 while $reference =~ s{ # x modifier is added to add formatting and improve readability + \G(\s*)(\S+):\d+ # \G is the last match in m//g (see also the (?=) syntax above) + # $2 is the file name + }{ + $self->{counter}{$2} ||= 0, # each file has its own counter + ++$self->{counter}{$2}, # increment it + $new_ref .= "$1$2:".$self->{counter}{$2} # replace line number by this counter + }gex && pos($reference); + $reference = $new_ref; + } + } elsif ($self->{options}{'porefs'} =~ m/^noline/) { + $reference =~ s/:\d+/:1/g; } if (defined($self->{po}{$msgid})) { @@ -1275,7 +1324,7 @@ if (defined $transref) { $self->{po}{$msgid}{'transref'} = $transref; } - if (defined $reference) { + if (defined($reference) && length($reference)) { if (defined $self->{po}{$msgid}{'reference'}) { $self->{po}{$msgid}{'reference'} .= " ".$reference; } else { Index: trunk/package/bin/po4a/lib/Locale/Po4a/Text.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/Text.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/Text.pm (revision 2380) @@ -150,6 +150,10 @@ my %control = (); +my $parse_func = \&parse_fallback; + +my @comments = (); + =back =cut @@ -189,22 +193,25 @@ } if (defined $options{'debianchangelog'}) { - $debianchangelog=1; + $parse_func = \&parse_debianchangelog; } if (defined $options{'fortunes'}) { - $fortunes=1; + $parse_func = \&parse_fortunes; } if (defined $options{'markdown'}) { + $parse_func = \&parse_markdown; $markdown=1; } if (defined $options{'asciidoc'}) { + $parse_func = \&parse_asciidoc; $asciidoc=1; } if (defined $options{'control'}) { + $parse_func = \&parse_control; if ($options{'control'} eq "1") { $control{''}=1; } else { @@ -215,173 +222,251 @@ } } -sub parse { - my $self = shift; - my ($line,$ref); - my $paragraph=""; - my $wrapped_mode = 1; - my $expect_header = 1; - my $end_of_paragraph = 0; - ($line,$ref)=$self->shiftline(); - my $file = $ref; - $file =~ s/:[0-9]+$// if defined($line); - while (defined($line)) { - $ref =~ m/^(.*):[0-9]+$/; - if ($1 ne $file) { - $file = $1; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - $expect_header = 1; +sub parse_fallback { + my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_; + if ( ($line =~ /^\s*$/) + or ( defined $breaks + and $line =~ m/^$breaks$/)) { + # Break paragraphs on lines containing only spaces + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1 unless defined($self->{verbatim}); + $self->pushline($line."\n"); + undef $self->{controlkey}; + } elsif ($line =~ /^-- $/) { + # Break paragraphs on email signature hint + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + $self->pushline($line."\n"); + } elsif ( $line =~ /^=+$/ + or $line =~ /^_+$/ + or $line =~ /^-+$/) { + $wrapped_mode = 0; + $paragraph .= $line."\n"; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + } elsif ($tabs eq "split" and $line =~ m/\t/ and $paragraph !~ m/\t/s) { + $wrapped_mode = 0; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph = "$line\n"; + $wrapped_mode = 0; + } elsif ($tabs eq "split" and $line !~ m/\t/ and $paragraph =~ m/\t/s) { + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph = "$line\n"; + $wrapped_mode = 1; + } else { + if ($line =~ /^\s/) { + # A line starting by a space indicates a non-wrap + # paragraph + $wrapped_mode = 0; } + if ($markdown and + ( $line =~ /\S $/ # explicit newline + or $line =~ /"""$/)) { # """ textblock inside macro begin + # Markdown markup needing separation _after_ this line + $end_of_paragraph = 1; + } else { + undef $self->{bullet}; + undef $self->{indent}; + } +# TODO: comments + $paragraph .= $line."\n"; + } + return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); +} - chomp($line); - $self->{ref}="$ref"; - if ($debianchangelog and - $expect_header and - $line =~ /^(\w[-+0-9a-z.]*)\ \(([^\(\) \t]+)\) # src, version - \s+([-+0-9a-z.]+); # distribution - \s*urgency\s*\=\s*(.*\S)\s*$/ix) { # - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $self->pushline("$line\n"); - $expect_header=0; - } elsif ($debianchangelog and - $line =~ m/^ \-\- (.*) <(.*)> ((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\\(\)]\))?)$/) { - # Found trailer - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $self->pushline("$line\n"); - $expect_header=1; - } elsif ($fortunes and - $line =~ m/^%%?\s*$/) { - # Found end of fortune - do_paragraph($self,$paragraph,$wrapped_mode); - $self->pushline("\n") unless ( $wrapped_mode == 0 - or $paragraph eq ""); - $paragraph=""; - $wrapped_mode = 1; - $self->pushline("$line\n"); - } elsif ( $line =~ m/^([^ :]*): *(.*)$/ - and %control) { - warn "Unrecognized section: '$paragraph'\n" - unless $paragraph eq ""; - my $tag = $1; - my $val = $2; - my $t; - if ($control{''} or $control{$tag}) { - $t = $self->translate($val, - $self->{ref}, - $tag.(defined $self->{controlkey}?", ".$self->{controlkey}:""), - "wrap" => 0); +sub parse_debianchangelog { + my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_; + if ($expect_header and + $line =~ /^(\w[-+0-9a-z.]*)\ \(([^\(\) \t]+)\) # src, version + \s+([-+0-9a-z.]+); # distribution + \s*urgency\s*\=\s*(.*\S)\s*$/ix) { # + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $self->pushline("$line\n"); + $expect_header=0; + } elsif ($line =~ m/^ \-\- (.*) <(.*)> ((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\\(\)]\))?)$/) { + # Found trailer + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $self->pushline("$line\n"); + $expect_header=1; + } else { + return parse_fallback($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); + } + return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); +} + +sub parse_fortunes { + my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_; + if ($line =~ m/^%%?\s*$/) { + # Found end of fortune + do_paragraph($self,$paragraph,$wrapped_mode); + $self->pushline("\n") unless ( $wrapped_mode == 0 + or $paragraph eq ""); + $paragraph=""; + $wrapped_mode = 1; + $self->pushline("$line\n"); + } else { + $line =~ s/%%(.*)$//; + } + return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); +} + +sub parse_control { + my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_; + if ($line =~ m/^([^ :]*): *(.*)$/) { + warn "Unrecognized section: '$paragraph'\n" + unless $paragraph eq ""; + my $tag = $1; + my $val = $2; + my $t; + if ($control{''} or $control{$tag}) { + $t = $self->translate($val, + $self->{ref}, + $tag.(defined $self->{controlkey}?", ".$self->{controlkey}:""), + "wrap" => 0); + } else { + $t = $val; + } + if (not defined $self->{controlkey}) { + $self->{controlkey} = "$tag: $val"; + } + $self->pushline("$tag: $t\n"); + $paragraph=""; + $wrapped_mode = 1; + $self->{bullet} = ""; + $self->{indent} = " "; + } elsif ($line eq " .") { + do_paragraph($self,$paragraph,$wrapped_mode, + "Long Description".(defined $self->{controlkey}?", ".$self->{controlkey}:"")); + $paragraph=""; + $self->pushline($line."\n"); + $self->{bullet} = ""; + $self->{indent} = " "; + } elsif ($line =~ m/^ Link: +(.*)$/) { + do_paragraph($self,$paragraph,$wrapped_mode, + "Long Description".(defined $self->{controlkey}?", ".$self->{controlkey}:"")); + my $link=$1; + my $t1 = $self->translate("Link: ", + $self->{ref}, + "Link", + "wrap" => 0); + my $t2 = $self->translate($link, + $self->{ref}, + "Link".(defined $self->{controlkey}?", ".$self->{controlkey}:""), + "wrap" => 0); + $self->pushline(" $t1$t2\n"); + $paragraph=""; + } elsif (defined $self->{indent} and + $line =~ m/^$self->{indent}\S/) { + $paragraph .= $line."\n"; + $self->{type} = "Long Description".(defined $self->{controlkey}?", ".$self->{controlkey}:""); + } else { + return parse_fallback($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); + } + return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); +} + +my $asciidoc_RE_SECTION_TEMPLATES = "sect1|sect2|sect3|sect4|preface|colophon|dedication|synopsis|index"; +my $asciidoc_RE_STYLE_ADMONITION = "TIP|NOTE|IMPORTANT|WARNING|CAUTION"; +my $asciidoc_RE_STYLE_PARAGRAPH = "normal|literal|verse|quote|listing|abstract|partintro|comment|example|sidebar|source|music|latex|graphviz"; +my $asciidoc_RE_STYLE_NUMBERING = "arabic|loweralpha|upperalpha|lowerroman|upperroman"; +my $asciidoc_RE_STYLE_LIST = "appendix|horizontal|qanda|glossary|bibliography"; +my $asciidoc_RE_STYLES = "$asciidoc_RE_SECTION_TEMPLATES|$asciidoc_RE_STYLE_ADMONITION|$asciidoc_RE_STYLE_PARAGRAPH|$asciidoc_RE_STYLE_NUMBERING|$asciidoc_RE_STYLE_LIST|float"; + +BEGIN { + my $UnicodeGCString_available = 0; + $UnicodeGCString_available = 1 if (eval { require Unicode::GCString }); + eval { + sub columns($$$) { + my $text = shift; + my $encoder = shift; + $text = $encoder->decode($text) if (defined($encoder) && $encoder->name ne "ascii"); + if ($UnicodeGCString_available) { + return Unicode::GCString->new($text)->columns(); } else { - $t = $val; + $text =~ s/\n$//s; + return length($text) if !(defined($encoder) && $encoder->name ne "ascii"); + die wrap_mod("po4a::text", + dgettext("po4a", "Detection of two line titles failed at %s\nInstall the Unicode::GCString module!"), shift) } - if (not defined $self->{controlkey}) { - $self->{controlkey} = "$tag: $val"; - } - $self->pushline("$tag: $t\n"); - $paragraph=""; + } + }; +} + +sub parse_asciidoc { + my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_; + if ((defined $self->{verbatim}) and ($self->{verbatim} == 3)) { + # Untranslated blocks + $self->pushline($line."\n"); + if ($line =~ m/^~{4,}$/) { + undef $self->{verbatim}; + undef $self->{type}; $wrapped_mode = 1; - $self->{bullet} = ""; - $self->{indent} = " "; - } elsif (%control and - $line eq " .") { - do_paragraph($self,$paragraph,$wrapped_mode, - "Long Description".(defined $self->{controlkey}?", ".$self->{controlkey}:"")); - $paragraph=""; - $self->pushline($line."\n"); - $self->{bullet} = ""; - $self->{indent} = " "; - } elsif (%control and - $line =~ m/^ Link: +(.*)$/) { - do_paragraph($self,$paragraph,$wrapped_mode, - "Long Description".(defined $self->{controlkey}?", ".$self->{controlkey}:"")); - my $link=$1; - my $t1 = $self->translate("Link: ", - $self->{ref}, - "Link", - "wrap" => 0); - my $t2 = $self->translate($link, - $self->{ref}, - "Link".(defined $self->{controlkey}?", ".$self->{controlkey}:""), - "wrap" => 0); - $self->pushline(" $t1$t2\n"); - $paragraph=""; - } elsif (%control and - defined $self->{indent} and - $line =~ m/^$self->{indent}\S/) { - $paragraph .= $line."\n"; - $self->{type} = "Long Description".(defined $self->{controlkey}?", ".$self->{controlkey}:""); - } elsif ( (defined $self->{verbatim}) - and ($self->{verbatim} == 2)) { - # Untranslated blocks - $self->pushline($line."\n"); - if ($asciidoc and - ($line =~ m/^(\/{4,}|~{4,})$/)) { - undef $self->{verbatim}; - undef $self->{type}; - $wrapped_mode = 1; - } - } elsif ( ($line =~ /^\s*$/) - or ( defined $breaks - and $line =~ m/^$breaks$/)) { - # Break paragraphs on lines containing only spaces - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1 unless defined($self->{verbatim}); - $self->pushline($line."\n"); - undef $self->{controlkey}; - } elsif ($asciidoc and (not defined($self->{verbatim})) and - ($line =~ m/^(\+|--)$/)) { - # List Item Continuation or List Block - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $self->pushline($line."\n"); - } elsif ($asciidoc and (not defined($self->{verbatim})) and - ($line =~ m/^(={4,}|-{4,}|~{4,}|\^{4,}|\+{4,})$/) and - (defined($paragraph) )and - ($paragraph =~ m/^[^\n]*\n$/s) and - (length($paragraph) == (length($line)+1))) { - # Found title - $wrapped_mode = 0; - my $level = $line; - $level =~ s/^(.).*$/$1/; - $paragraph =~ s/\n$//s; - my $t = $self->translate($paragraph, - $self->{ref}, - "Title $level", - "wrap" => 0); - $self->pushline($t."\n"); - $paragraph=""; + } + } elsif ((defined $self->{verbatim}) and ($self->{verbatim} == 2)) { + # CommentBlock + if ($line =~ m/^\/{4,}$/) { + undef $self->{verbatim}; + undef $self->{type}; $wrapped_mode = 1; - $self->pushline(($level x (length($t)))."\n"); - } elsif ($asciidoc and - ($line =~ m/^(={1,5})( +)(.*?)( +\1)?$/)) { - my $titlelevel1 = $1; - my $titlespaces = $2; - my $title = $3; - my $titlelevel2 = $4||""; - # Found one line title + } else { + push @comments, $line; + } + } elsif ((not defined($self->{verbatim})) and ($line =~ m/^(\+|--)$/)) { + # List Item Continuation or List Block + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $self->pushline($line."\n"); + } elsif ((not defined($self->{verbatim})) and + ($line =~ m/^(={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})$/) and + (defined($paragraph) )and + ($paragraph =~ m/^[^\n]*\n$/s) and + (columns($paragraph, $self->{TT}{po_in}{encoder}, $ref) == (length($line)))) { + # Found title + $wrapped_mode = 0; + my $level = $line; + $level =~ s/^(.).*$/$1/; + $paragraph =~ s/\n$//s; + my $t = $self->translate($paragraph, + $self->{ref}, + "Title $level", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline($t."\n"); + $paragraph=""; + @comments=(); + $wrapped_mode = 1; + $self->pushline(($level x (columns($t, $self->{TT}{po_in}{encoder}, $ref)))."\n"); + } elsif ($line =~ m/^(={1,5})( +)(.*?)( +\1)?$/) { + my $titlelevel1 = $1; + my $titlespaces = $2; + my $title = $3; + my $titlelevel2 = $4||""; + # Found one line title + do_paragraph($self,$paragraph,$wrapped_mode); + $wrapped_mode = 0; + $paragraph=""; + my $t = $self->translate($title, + $self->{ref}, + "Title $titlelevel1", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline($titlelevel1.$titlespaces.$t.$titlelevel2."\n"); + @comments=(); + $wrapped_mode = 1; + } elsif ($line =~ m/^(\/{4,}|\+{4,}|-{4,}|\.{4,}|\*{4,}|_{4,}|={4,}|~{4,}|\|={4,})$/) { + # Found one delimited block + my $t = $line; + $t =~ s/^(.).*$/$1/; + my $type = "delimited block $t"; + if (defined $self->{verbatim} and ($self->{type} ne $type)) { + $paragraph .= "$line\n"; + } else { do_paragraph($self,$paragraph,$wrapped_mode); - $wrapped_mode = 0; - $paragraph=""; - my $t = $self->translate($title, - $self->{ref}, - "Title $titlelevel1", - "wrap" => 0); - $self->pushline($titlelevel1.$titlespaces.$t.$titlelevel2."\n"); - $wrapped_mode = 1; - } elsif ($asciidoc and - ($line =~ m/^(\/{4,}|\+{4,}|-{4,}|\.{4,}|\*{4,}|_{4,}|={4,}|~{4,})$/)) { - # Found one delimited block - my $t = $line; - $t =~ s/^(.).*$/$1/; - my $type = "delimited block $t"; - if (defined $self->{verbatim} and ($self->{type} ne $type)) { - $paragraph .= "$line\n"; - } else { - do_paragraph($self,$paragraph,$wrapped_mode); if ( (defined $self->{type}) and ($self->{type} eq $type)) { undef $self->{type}; @@ -395,7 +480,7 @@ # PassthroughBlock $wrapped_mode = 0; $self->{verbatim} = 1; - } elsif ($t eq "-") { + } elsif ($t eq "-" or $t eq "|") { # ListingBlock $wrapped_mode = 0; $self->{verbatim} = 1; @@ -421,295 +506,298 @@ } elsif ($t eq "~") { # Filter blocks, TBC: not translated $wrapped_mode = 0; - $self->{verbatim} = 2; + $self->{verbatim} = 3; } $self->{type} = $type; } $paragraph=""; - $self->pushline($line."\n"); - } - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^\[\[([^\]]*)\]\]$/)) { - # Found BlockId - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - $self->pushline($line."\n"); - undef $self->{bullet}; - undef $self->{indent}; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($paragraph eq "") and - ($line =~ m/^((?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+)(.*)$/)) { - my $type = $1; - my $text = $2; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=$text."\n"; - $wrapped_mode = 1; - $self->pushline($type); - undef $self->{bullet}; - undef $self->{indent}; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION|verse|quote)\]$/)) { - my $type = $1; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - $self->pushline($line."\n"); - if ($type eq "verse") { - $wrapped_mode = 0; - } - undef $self->{bullet}; - undef $self->{indent}; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^\[(verse|quote), +(.*)\]$/)) { - my $type = $1; - my $arg = $2; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - my $t = $self->translate($arg, - $self->{ref}, - "$type", - "wrap" => 0); - $self->pushline("[$type, $t]\n"); - $wrapped_mode = 1; - if ($type eq "verse") { - $wrapped_mode = 0; - } - $self->{type} = $type; - undef $self->{bullet}; - undef $self->{indent}; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^\[icon="(.*)"\]$/)) { - my $arg = $1; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - my $t = $self->translate($arg, - $self->{ref}, - "icon", - "wrap" => 0); - $self->pushline("[icon=\"$t\"]\n"); - $wrapped_mode = 1; - undef $self->{bullet}; - undef $self->{indent}; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^\[icons=None, +caption="(.*)"\]$/)) { - my $arg = $1; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - my $t = $self->translate($arg, - $self->{ref}, - "caption", - "wrap" => 0); - $self->pushline("[icons=None, caption=\"$t\"]\n"); - $wrapped_mode = 1; - undef $self->{bullet}; - undef $self->{indent}; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^(\s*)([*_+`'#[:alnum:]].*)((?:::|;;|\?\?|:-)(?: *\\)?)$/)) { - my $indent = $1; - my $label = $2; - my $labelend = $3; - # Found labeled list - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - $self->{bullet} = ""; + $self->pushline($line."\n") unless defined($self->{verbatim}) && $self->{verbatim} == 2; + } + } elsif ((not defined($self->{verbatim})) and ($line =~ m/^\/\/(.*)/)) { + # Comment line + push @comments, $1; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^\[\[([^\]]*)\]\]$/)) { + # Found BlockId + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + $self->pushline($line."\n"); + undef $self->{bullet}; + undef $self->{indent}; + } elsif (not defined $self->{verbatim} and + ($paragraph eq "") and + ($line =~ m/^((?:$asciidoc_RE_STYLE_ADMONITION):\s+)(.*)$/)) { + my $type = $1; + my $text = $2; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=$text."\n"; + $wrapped_mode = 1; + $self->pushline($type); + undef $self->{bullet}; + undef $self->{indent}; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^\[($asciidoc_RE_STYLES)\]$/)) { + my $type = $1; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + $self->pushline($line."\n"); + if ($type eq "verse") { + $wrapped_mode = 0; + } + undef $self->{bullet}; + undef $self->{indent}; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^\[(['"]?)(verse|quote)\1, +(.*)\]$/)) { + my $quote = $1 || ''; + my $type = $2; + my $arg = $3; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + my $t = $self->translate($arg, + $self->{ref}, + "$type", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline("[$quote$type$quote, $t]\n"); + @comments=(); + $wrapped_mode = 1; + if ($type eq "verse") { + $wrapped_mode = 0; + } + $self->{type} = $type; + undef $self->{bullet}; + undef $self->{indent}; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^\[icon="(.*)"\]$/)) { + my $arg = $1; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + my $t = $self->translate($arg, + $self->{ref}, + "icon", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline("[icon=\"$t\"]\n"); + @comments=(); + $wrapped_mode = 1; + undef $self->{bullet}; + undef $self->{indent}; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^\[icons=None, +caption="(.*)"\]$/)) { + my $arg = $1; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + my $t = $self->translate($arg, + $self->{ref}, + "caption", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline("[icons=None, caption=\"$t\"]\n"); + @comments=(); + $wrapped_mode = 1; + undef $self->{bullet}; + undef $self->{indent}; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^(\s*)([*_+`'#[:alnum:]].*)((?:::|;;|\?\?|:-)(?: *\\)?)$/)) { + my $indent = $1; + my $label = $2; + my $labelend = $3; + # Found labeled list + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + $self->{bullet} = ""; + $self->{indent} = $indent; + my $t = $self->translate($label, + $self->{ref}, + "Labeled list", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline("$indent$t$labelend\n"); + @comments=(); + } elsif (not defined $self->{verbatim} and + ($line =~ m/^(\s*)(\S.*)((?:::|;;)\s+)(.*)$/)) { + my $indent = $1; + my $label = $2; + my $labelend = $3; + my $labeltext = $4; + # Found Horizontal Labeled Lists + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=$labeltext."\n"; + $wrapped_mode = 1; + $self->{bullet} = ""; + $self->{indent} = $indent; + my $t = $self->translate($label, + $self->{ref}, + "Labeled list", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline("$indent$t$labelend"); + @comments=(); + } elsif (not defined $self->{verbatim} and + ($line =~ m/^\:(\S.*?)(:\s*)(.*)$/)) { + my $attrname = $1; + my $attrsep = $2; + my $attrvalue = $3; + # Found a Attribute entry + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + undef $self->{bullet}; + undef $self->{indent}; + my $t = $self->translate($attrvalue, + $self->{ref}, + "Attribute :$attrname:", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline(":$attrname$attrsep$t\n"); + @comments=(); + } elsif (not defined $self->{verbatim} and + ($line !~ m/^\.\./) and ($line =~ m/^\.(\S.*)$/)) { + my $title = $1; + # Found block title + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + undef $self->{bullet}; + undef $self->{indent}; + my $t = $self->translate($title, + $self->{ref}, + "Block title", + "comment" => join("\n", @comments), + "wrap" => 0); + $self->pushline(".$t\n"); + @comments=(); + } elsif (not defined $self->{verbatim} and + ($line =~ m/^(\s*)((?:[-*o+]|(?:[0-9]+[.\)])|(?:[a-z][.\)])|\([0-9]+\)|\.|\.\.)\s+)(.*)$/)) { + my $indent = $1||""; + my $bullet = $2; + my $text = $3; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph = $text."\n"; + $self->{indent} = $indent; + $self->{bullet} = $bullet; + } elsif (not defined $self->{verbatim} and + ($line =~ m/^((?: +)(.*)$/)) { + my $bullet = $1; + my $text = $2; + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph = $text."\n"; + $self->{indent} = ""; + $self->{bullet} = $bullet; + } elsif (not defined $self->{verbatim} and + (defined $self->{bullet} and $line =~ m/^(\s+)(.*)$/)) { + my $indent = $1; + my $text = $2; + if (not defined $self->{indent}) { + $paragraph .= $text."\n"; $self->{indent} = $indent; - my $t = $self->translate($label, - $self->{ref}, - "Labeled list", - "wrap" => 0); - $self->pushline("$indent$t$labelend\n"); - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^(\s*)(\S.*)((?:::|;;)\s+)(.*)$/)) { - my $indent = $1; - my $label = $2; - my $labelend = $3; - my $labeltext = $4; - # Found Horizontal Labeled Lists + } elsif (length($paragraph) and (length($self->{bullet}) + length($self->{indent}) == length($indent))) { + $paragraph .= $text."\n"; + } else { do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=$labeltext."\n"; - $wrapped_mode = 1; - $self->{bullet} = ""; - $self->{indent} = $indent; - my $t = $self->translate($label, - $self->{ref}, - "Labeled list", - "wrap" => 0); - $self->pushline("$indent$t$labelend"); - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^\:(\S.*?)(:\s*)(.*)$/)) { - my $attrname = $1; - my $attrsep = $2; - my $attrvalue = $3; - # Found a Attribute entry - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - undef $self->{bullet}; - undef $self->{indent}; - my $t = $self->translate($attrvalue, - $self->{ref}, - "Attribute :$attrname:", - "wrap" => 0); - $self->pushline(":$attrname$attrsep$t\n"); - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line !~ m/^\.\./) and ($line =~ m/^\.(\S.*)$/)) { - my $title = $1; - # Found block title - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - undef $self->{bullet}; - undef $self->{indent}; - my $t = $self->translate($title, - $self->{ref}, - "Block title", - "wrap" => 0); - $self->pushline(".$t\n"); - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^(\s*)((?:[-*o+]|(?:[0-9]+[.\)])|(?:[a-z][.\)])|\([0-9]+\)|\.|\.\.)\s+)(.*)$/)) { - my $indent = $1||""; - my $bullet = $2; - my $text = $3; - do_paragraph($self,$paragraph,$wrapped_mode); $paragraph = $text."\n"; $self->{indent} = $indent; - $self->{bullet} = $bullet; - } elsif ($asciidoc and not defined $self->{verbatim} and - ($line =~ m/^((?: +)(.*)$/)) { - my $bullet = $1; - my $text = $2; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph = $text."\n"; - $self->{indent} = ""; - $self->{bullet} = $bullet; - } elsif ($asciidoc and not defined $self->{verbatim} and - (defined $self->{bullet} and $line =~ m/^(\s+)(.*)$/)) { - my $indent = $1; - my $text = $2; - if (not defined $self->{indent}) { - $paragraph .= $text."\n"; - $self->{indent} = $indent; - } elsif (length($paragraph) and (length($self->{bullet}) + length($self->{indent}) == length($indent))) { - $paragraph .= $text."\n"; - } else { + $self->{bullet} = ""; + } + } else { + return parse_fallback($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); + } + return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); +} - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph = $text."\n"; - $self->{indent} = $indent; - $self->{bullet} = ""; - } - } elsif ($markdown and - (not defined($self->{verbatim})) and - ($line =~ m/^(={4,}|-{4,})$/) and - (defined($paragraph) )and - ($paragraph =~ m/^[^\n]*\n$/s) and - (length($paragraph) == (length($line)+1))) { - # XXX: There can be any number of underlining according - # to the documentation. This detection, which avoid - # translating the formatting, is only supported if - # the underlining has the same size as the header text. - # Found title - $wrapped_mode = 0; - my $level = $line; - $level =~ s/^(.).*$/$1/; - my $t = $self->translate($paragraph, - $self->{ref}, - "Title $level", - "wrap" => 0); - $self->pushline($t); - $paragraph=""; - $wrapped_mode = 1; - $self->pushline(($level x (length($t)-1))."\n"); - } elsif ($markdown and - ($line =~ m/^(#{1,6})( +)(.*?)( +\1)?$/)) { - my $titlelevel1 = $1; - my $titlespaces = $2; - my $title = $3; - my $titlelevel2 = $4||""; - # Found one line title +sub parse_markdown { + my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_; + if (($line =~ m/^(={4,}|-{4,})$/) and + (defined($paragraph) ) and + ($paragraph =~ m/^[^\n]*\n$/s) and + (length($paragraph) == (length($line)+1))) { + # XXX: There can be any number of underlining according + # to the documentation. This detection, which avoid + # translating the formatting, is only supported if + # the underlining has the same size as the header text. + # Found title + $wrapped_mode = 0; + my $level = $line; + $level =~ s/^(.).*$/$1/; + my $t = $self->translate($paragraph, + $self->{ref}, + "Title $level", + "wrap" => 0); + $self->pushline($t); + $paragraph=""; + $wrapped_mode = 1; + $self->pushline(($level x (length($t)-1))."\n"); + } elsif ($line =~ m/^(#{1,6})( +)(.*?)( +\1)?$/) { + my $titlelevel1 = $1; + my $titlespaces = $2; + my $title = $3; + my $titlelevel2 = $4||""; + # Found one line title + do_paragraph($self,$paragraph,$wrapped_mode); + $wrapped_mode = 0; + $paragraph=""; + my $t = $self->translate($title, + $self->{ref}, + "Title $titlelevel1", + "wrap" => 0); + $self->pushline($titlelevel1.$titlespaces.$t.$titlelevel2."\n"); + $wrapped_mode = 1; + } elsif (($paragraph eq "") and + ($line =~ /^((\*\s*){3,}|(-\s*){3,}|(_\s*){3,})$/)) { + # Horizontal rule + $wrapped_mode = 1; + $self->pushline($line."\n"); + } elsif ( $line =~ /^\s*\[\[\!\S+\s*$/ # macro begin + or $line =~ /^\s*"""\s*\]\]\s*$/) { # """ textblock inside macro end + # Avoid translating Markdown lines containing only markup + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph=""; + $wrapped_mode = 1; + $self->pushline("$line\n"); + } elsif ( $line =~ /^#/ # headline + or $line =~ /^\s*\[\[\!\S[^\]]*\]\]\s*$/) { # sole macro + # Preserve some Markdown markup as a single line + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph="$line\n"; + $wrapped_mode = 0; + $end_of_paragraph = 1; + } elsif ($line =~ /^"""/) { # """ textblock inside macro end + # Markdown markup needing separation _before_ this line + do_paragraph($self,$paragraph,$wrapped_mode); + $paragraph="$line\n"; + $wrapped_mode = 1; + } else { + return parse_fallback($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); + } + return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); +} + +sub parse { + my $self = shift; + my ($line,$ref); + my $paragraph=""; + my $wrapped_mode = 1; + my $expect_header = 1; + my $end_of_paragraph = 0; + ($line,$ref)=$self->shiftline(); + my $file = $ref; + $file =~ s/:[0-9]+$// if defined($line); + while (defined($line)) { + $ref =~ m/^(.*):[0-9]+$/; + if ($1 ne $file) { + $file = $1; do_paragraph($self,$paragraph,$wrapped_mode); - $wrapped_mode = 0; $paragraph=""; - my $t = $self->translate($title, - $self->{ref}, - "Title $titlelevel1", - "wrap" => 0); - $self->pushline($titlelevel1.$titlespaces.$t.$titlelevel2."\n"); $wrapped_mode = 1; - } elsif ($markdown and - ($paragraph eq "") and - ($line =~ /^((\*\s*){3,}|(-\s*){3,}|(_\s*){3,})$/)) { - # Horizontal rule - $wrapped_mode = 1; - $self->pushline($line."\n"); - } elsif ($line =~ /^-- $/) { - # Break paragraphs on email signature hint - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - $self->pushline($line."\n"); - } elsif ( $line =~ /^=+$/ - or $line =~ /^_+$/ - or $line =~ /^-+$/) { - $wrapped_mode = 0; - $paragraph .= $line."\n"; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - } elsif ($markdown and - ( $line =~ /^\s*\[\[\!\S+\s*$/ # macro begin - or $line =~ /^\s*"""\s*\]\]\s*$/)) { # """ textblock inside macro end - # Avoid translating Markdown lines containing only markup - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph=""; - $wrapped_mode = 1; - $self->pushline("$line\n"); - } elsif ($markdown and - ( $line =~ /^#/ # headline - or $line =~ /^\s*\[\[\!\S[^\]]*\]\]\s*$/)) { # sole macro - # Preserve some Markdown markup as a single line - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph="$line\n"; - $wrapped_mode = 0; - $end_of_paragraph = 1; - } elsif ($markdown and - ( $line =~ /^"""/)) { # """ textblock inside macro end - # Markdown markup needing separation _before_ this line - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph="$line\n"; - $wrapped_mode = 1; - } elsif ($tabs eq "split" and $line =~ m/\t/ and $paragraph !~ m/\t/s) { - $wrapped_mode = 0; - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph = "$line\n"; - $wrapped_mode = 0; - } elsif ($tabs eq "split" and $line !~ m/\t/ and $paragraph =~ m/\t/s) { - do_paragraph($self,$paragraph,$wrapped_mode); - $paragraph = "$line\n"; - $wrapped_mode = 1; - } else { - if ($line =~ /^\s/) { - # A line starting by a space indicates a non-wrap - # paragraph - $wrapped_mode = 0; - } - if ($markdown and - ( $line =~ /\S $/ # explicit newline - or $line =~ /"""$/)) { # """ textblock inside macro begin - # Markdown markup needing separation _after_ this line - $end_of_paragraph = 1; - } else { - undef $self->{bullet}; - undef $self->{indent}; - } - if ($fortunes) { - $line =~ s/%%(.*)$//; - } -# TODO: comments - $paragraph .= $line."\n"; + $expect_header = 1; } + + chomp($line); + $self->{ref}="$ref"; + ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = &$parse_func($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph); # paragraphs starting by a bullet, or numbered # or paragraphs with a line containing many consecutive spaces # (more than 3) @@ -811,7 +899,9 @@ my $t = $self->translate($paragraph, $self->{ref}, $type, + "comment" => join("\n", @comments), "wrap" => $wrap); + @comments = (); if (defined $self->{bullet}) { my $bullet = $self->{bullet}; my $indent1 = $self->{indent}; Index: trunk/package/bin/po4a/lib/Locale/Po4a/TransTractor.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/TransTractor.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/TransTractor.pm (revision 2380) @@ -11,7 +11,7 @@ use subs qw(makespace); use vars qw($VERSION @ISA @EXPORT); -$VERSION="0.41.1"; +$VERSION="0.44"; @ISA = qw(DynaLoader); @EXPORT = qw(new process translate read write readpo writepo @@ -131,28 +131,28 @@ my $first=1; my ($line,$lref)=$self->shiftline(); while (defined($line)) { - if ($line =~ m/

/ && !$first--; ) { - # Not the first time we see

. - # Reput the current line in input, - # and put the built paragraph to output - $self->unshiftline($line,$lref); + if ($line =~ m/

/ && !$first--; ) { + # Not the first time we see

. + # Reput the current line in input, + # and put the built paragraph to output + $self->unshiftline($line,$lref); - # Now that the document is formed, translate it: - # - Remove the leading tag - $paragraph =~ s/^

//s; + # Now that the document is formed, translate it: + # - Remove the leading tag + $paragraph =~ s/^

//s; - # - push to output the leading tag (untranslated) and the - # rest of the paragraph (translated) - $self->pushline( "

" + # - push to output the leading tag (untranslated) and the + # rest of the paragraph (translated) + $self->pushline( "

" . $document->translate($paragraph,$pararef) ); - next PARAGRAPH; - } else { - # Append to the paragraph - $paragraph .= $line; - $pararef = $lref unless(length($pararef)); - } + next PARAGRAPH; + } else { + # Append to the paragraph + $paragraph .= $line; + $pararef = $lref unless(length($pararef)); + } # Reinit the loop ($line,$lref)=$self->shiftline(); @@ -275,63 +275,63 @@ # Build the args for new() my %newparams = (); foreach (keys %params) { - next if ($_ eq 'po_in_name' || - $_ eq 'po_out_name' || - $_ eq 'file_in_name' || - $_ eq 'file_in_charset' || - $_ eq 'file_out_name' || - $_ eq 'file_out_charset' || - $_ eq 'addendum' || - $_ eq 'addendum_charset'); - $newparams{$_}=$params{$_}; + next if ($_ eq 'po_in_name' || + $_ eq 'po_out_name' || + $_ eq 'file_in_name' || + $_ eq 'file_in_charset' || + $_ eq 'file_out_name' || + $_ eq 'file_out_charset' || + $_ eq 'addendum' || + $_ eq 'addendum_charset'); + $newparams{$_}=$params{$_}; } $self->detected_charset($params{'file_in_charset'}); $self->{TT}{'file_out_charset'}=$params{'file_out_charset'}; if (defined($self->{TT}{'file_out_charset'}) and - length($self->{TT}{'file_out_charset'})) { - $self->{TT}{'file_out_encoder'} = find_encoding($self->{TT}{'file_out_charset'}); + length($self->{TT}{'file_out_charset'})) { + $self->{TT}{'file_out_encoder'} = find_encoding($self->{TT}{'file_out_charset'}); } $self->{TT}{'addendum_charset'}=$params{'addendum_charset'}; chdir $params{'srcdir'} - if (defined $params{'srcdir'}); + if (defined $params{'srcdir'}); foreach my $file (@{$params{'po_in_name'}}) { - print STDERR "readpo($file)... " if $self->debug(); - $self->readpo($file); - print STDERR "done.\n" if $self->debug() + print STDERR "readpo($file)... " if $self->debug(); + $self->readpo($file); + print STDERR "done.\n" if $self->debug() } foreach my $file (@{$params{'file_in_name'}}) { - print STDERR "read($file)..." if $self->debug(); - $self->read($file); - print STDERR "done.\n" if $self->debug(); + print STDERR "read($file)..." if $self->debug(); + $self->read($file); + print STDERR "done.\n" if $self->debug(); } print STDERR "parse..." if $self->debug(); $self->parse(); print STDERR "done.\n" if $self->debug(); foreach my $file (@{$params{'addendum'}}) { - print STDERR "addendum($file)..." if $self->debug(); - $self->addendum($file) || die "An addendum failed\n"; - print STDERR "done.\n" if $self->debug(); + print STDERR "addendum($file)..." if $self->debug(); + $self->addendum($file) || die "An addendum failed\n"; + print STDERR "done.\n" if $self->debug(); } chdir $params{'destdir'} - if (defined $params{'destdir'}); + if (defined $params{'destdir'}); if (defined $params{'file_out_name'}) { - print STDERR "write(".$params{'file_out_name'}.")... " - if $self->debug(); - $self->write($params{'file_out_name'}); - print STDERR "done.\n" if $self->debug(); + print STDERR "write(".$params{'file_out_name'}.")... " + if $self->debug(); + $self->write($params{'file_out_name'}); + print STDERR "done.\n" if $self->debug(); } chdir $params{'srcdir'} - if (defined $params{'srcdir'}); + if (defined $params{'srcdir'}); if (defined $params{'po_out_name'}) { - print STDERR "writepo(".$params{'po_out_name'}.")... " - if $self->debug(); - $self->writepo($params{'po_out_name'}); - print STDERR "done.\n" if $self->debug(); + print STDERR "writepo(".$params{'po_out_name'}.")... " + if $self->debug(); + $self->writepo($params{'po_out_name'}); + print STDERR "done.\n" if $self->debug(); } chdir $params{'calldir'} - if (defined $params{'calldir'}); + if (defined $params{'calldir'}); return $self; } @@ -372,10 +372,10 @@ $self->{TT}{doc_in}=(); $self->{TT}{doc_out}=(); if (defined $options{'verbose'}) { - $self->{TT}{verbose} = $options{'verbose'}; + $self->{TT}{verbose} = $options{'verbose'}; } if (defined $options{'debug'}) { - $self->{TT}{debug} = $options{'debug'}; + $self->{TT}{debug} = $options{'debug'}; } # Input document is in ascii until we prove the opposite (in read()) $self->{TT}{ascii_input}=1; @@ -383,7 +383,6 @@ # document isn't in ascii) $self->{TT}{utf_mode}=0; - return $self; } @@ -407,33 +406,33 @@ sub read() { my $self=shift; my $filename=shift - or croak wrap_msg(dgettext("po4a", "Can't read from file without having a filename")); + or croak wrap_msg(dgettext("po4a", "Can't read from file without having a filename")); my $linenum=0; open INPUT,"<$filename" - or croak wrap_msg(dgettext("po4a", "Can't read from %s: %s"), $filename, $!); + or croak wrap_msg(dgettext("po4a", "Can't read from %s: %s"), $filename, $!); while (defined (my $textline = )) { - $linenum++; - my $ref="$filename:$linenum"; - $textline =~ s/\r$//; - my @entry=($textline,$ref); - push @{$self->{TT}{doc_in}}, @entry; + $linenum++; + my $ref="$filename:$linenum"; + $textline =~ s/\r$//; + my @entry=($textline,$ref); + push @{$self->{TT}{doc_in}}, @entry; - if (!defined($self->{TT}{'file_in_charset'})) { - # Detect if this file has non-ascii characters - if($self->{TT}{ascii_input}) { - my $decoder = guess_encoding($textline); - if (!ref($decoder) or $decoder !~ /Encode::XS=/) { - # We have detected a non-ascii line - $self->{TT}{ascii_input} = 0; - # Save the reference for future error message - $self->{TT}{non_ascii_ref} ||= $ref; - } - } - } + if (!defined($self->{TT}{'file_in_charset'})) { + # Detect if this file has non-ascii characters + if($self->{TT}{ascii_input}) { + my $decoder = guess_encoding($textline); + if (!ref($decoder) or $decoder !~ /Encode::XS=/) { + # We have detected a non-ascii line + $self->{TT}{ascii_input} = 0; + # Save the reference for future error message + $self->{TT}{non_ascii_ref} ||= $ref; + } + } + } } close INPUT - or croak wrap_msg(dgettext("po4a", "Can't close %s after reading: %s"), $filename, $!); + or croak wrap_msg(dgettext("po4a", "Can't close %s after reading: %s"), $filename, $!); } @@ -446,29 +445,29 @@ sub write { my $self=shift; my $filename=shift - or croak wrap_msg(dgettext("po4a", "Can't write to a file without filename")); + or croak wrap_msg(dgettext("po4a", "Can't write to a file without filename")); my $fh; if ($filename eq '-') { - $fh=\*STDOUT; + $fh=\*STDOUT; } else { - # make sure the directory in which we should write the localized file exists - my $dir = $filename; - if ($dir =~ m|/|) { - $dir =~ s|/[^/]*$||; + # make sure the directory in which we should write the localized file exists + my $dir = $filename; + if ($dir =~ m|/|) { + $dir =~ s|/[^/]*$||; - File::Path::mkpath($dir, 0, 0755) # Croaks on error - if (length ($dir) && ! -e $dir); - } - open $fh,">$filename" - or croak wrap_msg(dgettext("po4a", "Can't write to %s: %s"), $filename, $!); + File::Path::mkpath($dir, 0, 0755) # Croaks on error + if (length ($dir) && ! -e $dir); + } + open $fh,">$filename" + or croak wrap_msg(dgettext("po4a", "Can't write to %s: %s"), $filename, $!); } map { print $fh $_ } $self->docheader(); map { print $fh $_ } @{$self->{TT}{doc_out}}; if ($filename ne '-') { - close $fh or croak wrap_msg(dgettext("po4a", "Can't close %s after writing: %s"), $filename, $!); + close $fh or croak wrap_msg(dgettext("po4a", "Can't close %s after writing: %s"), $filename, $!); } } @@ -541,63 +540,65 @@ my ($filename,$header)=shift; my ($errcode,$mode,$position,$boundary,$bmode,$content)= - (1,"","","","",""); + (1,"","","","",""); unless (open (INS, "<$filename")) { - warn wrap_msg(dgettext("po4a", "Can't read from %s: %s"), $filename, $!); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "Can't read from %s: %s"), $filename, $!); + goto END_PARSE_ADDFILE; } unless (defined ($header=) && $header) { - warn wrap_msg(dgettext("po4a", "Can't read po4a header from %s."), $filename); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "Can't read po4a header from %s."), $filename); + goto END_PARSE_ADDFILE; } unless ($header =~ s/PO4A-HEADER://i) { - warn wrap_msg(dgettext("po4a", "First line of %s does not look like a po4a header."), $filename); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "First line of %s does not look like a po4a header."), $filename); + goto END_PARSE_ADDFILE; } foreach my $part (split(/;/,$header)) { - unless ($part =~ m/^\s*([^=]*)=(.*)$/) { - warn wrap_msg(dgettext("po4a", "Syntax error in po4a header of %s, near \"%s\""), $filename, $part); - goto END_PARSE_ADDFILE; - } - my ($key,$value)=($1,$2); - $key=lc($key); - if ($key eq 'mode') { $mode=lc($value); - } elsif ($key eq 'position') { $position=$value; - } elsif ($key eq 'endboundary') { - $boundary=$value; - $bmode='after'; - } elsif ($key eq 'beginboundary') { - $boundary=$value; - $bmode='before'; - } else { - warn wrap_msg(dgettext("po4a", "Invalid argument in the po4a header of %s: %s"), $filename, $key); - goto END_PARSE_ADDFILE; - } + unless ($part =~ m/^\s*([^=]*)=(.*)$/) { + warn wrap_msg(dgettext("po4a", "Syntax error in po4a header of %s, near \"%s\""), $filename, $part); + goto END_PARSE_ADDFILE; + } + my ($key,$value)=($1,$2); + $key=lc($key); + if ($key eq 'mode') { + $mode=lc($value); + } elsif ($key eq 'position') { + $position=$value; + } elsif ($key eq 'endboundary') { + $boundary=$value; + $bmode='after'; + } elsif ($key eq 'beginboundary') { + $boundary=$value; + $bmode='before'; + } else { + warn wrap_msg(dgettext("po4a", "Invalid argument in the po4a header of %s: %s"), $filename, $key); + goto END_PARSE_ADDFILE; + } } unless (length($mode)) { - warn wrap_msg(dgettext("po4a", "The po4a header of %s does not define the mode."), $filename); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "The po4a header of %s does not define the mode."), $filename); + goto END_PARSE_ADDFILE; } unless ($mode eq "before" || $mode eq "after") { - warn wrap_msg(dgettext("po4a", "Mode invalid in the po4a header of %s: should be 'before' or 'after' not %s."), $filename, $mode); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "Mode invalid in the po4a header of %s: should be 'before' or 'after' not %s."), $filename, $mode); + goto END_PARSE_ADDFILE; } unless (length($position)) { - warn wrap_msg(dgettext("po4a", "The po4a header of %s does not define the position."), $filename); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "The po4a header of %s does not define the position."), $filename); + goto END_PARSE_ADDFILE; } unless ($mode eq "before" || length($boundary)) { - warn wrap_msg(dgettext("po4a", "No ending boundary given in the po4a header, but mode=after.")); - goto END_PARSE_ADDFILE; + warn wrap_msg(dgettext("po4a", "No ending boundary given in the po4a header, but mode=after.")); + goto END_PARSE_ADDFILE; } while (defined(my $line = )) { - $content .= $line; + $content .= $line; } close INS; @@ -617,15 +618,15 @@ print STDERR "Apply addendum $filename..." if $self->debug(); unless ($filename) { - warn wrap_msg(dgettext("po4a", - "Can't apply addendum when not given the filename")); - return 0; + warn wrap_msg(dgettext("po4a", + "Can't apply addendum when not given the filename")); + return 0; } die wrap_msg(dgettext("po4a", "Addendum %s does not exist."), $filename) unless -e $filename; my ($errcode,$mode,$position,$boundary,$bmode,$content)= - addendum_parse($filename); + addendum_parse($filename); return 0 if ($errcode); print STDERR "mode=$mode;pos=$position;bound=$boundary;bmode=$bmode;ctn=$content\n" @@ -635,68 +636,68 @@ # suppose it's already in the output document's charset if (defined($self->{TT}{'addendum_charset'}) && length($self->{TT}{'addendum_charset'})) { - Encode::from_to($content,$self->{TT}{'addendum_charset'}, - $self->get_out_charset); + Encode::from_to($content,$self->{TT}{'addendum_charset'}, + $self->get_out_charset); } my $found = scalar grep { /$position/ } @{$self->{TT}{doc_out}}; if ($found == 0) { - warn wrap_msg(dgettext("po4a", - "No candidate position for the addendum %s."), $filename); - return 0; + warn wrap_msg(dgettext("po4a", + "No candidate position for the addendum %s."), $filename); + return 0; } if ($found > 1) { - warn wrap_msg(dgettext("po4a", - "More than one candidate position found for the addendum %s."), $filename); - return 0; + warn wrap_msg(dgettext("po4a", + "More than one candidate position found for the addendum %s."), $filename); + return 0; } if ($mode eq "before") { - if ($self->verbose() > 1 || $self->debug() ) { - map { print STDERR wrap_msg(dgettext("po4a", "Addendum '%s' applied before this line: %s"), $filename, $_) if (/$position/); - } @{$self->{TT}{doc_out}}; - } - @{$self->{TT}{doc_out}} = map { /$position/ ? ($content,$_) : $_ + if ($self->verbose() > 1 || $self->debug() ) { + map { print STDERR wrap_msg(dgettext("po4a", "Addendum '%s' applied before this line: %s"), $filename, $_) if (/$position/); + } @{$self->{TT}{doc_out}}; + } + @{$self->{TT}{doc_out}} = map { /$position/ ? ($content,$_) : $_ } @{$self->{TT}{doc_out}}; } else { - my @newres=(); + my @newres=(); - do { - # make sure it doesn't whine on empty document - my $line = scalar @{$self->{TT}{doc_out}} ? shift @{$self->{TT}{doc_out}} : ""; - push @newres,$line; - my $outline=mychomp($line); - $outline =~ s/^[ \t]*//; + do { + # make sure it doesn't whine on empty document + my $line = scalar @{$self->{TT}{doc_out}} ? shift @{$self->{TT}{doc_out}} : ""; + push @newres,$line; + my $outline=mychomp($line); + $outline =~ s/^[ \t]*//; - if ($line =~ m/$position/) { - while ($line=shift @{$self->{TT}{doc_out}}) { - last if ($line=~/$boundary/); - push @newres,$line; - } - if (defined $line) { - if ($bmode eq 'before') { - print wrap_msg(dgettext("po4a", - "Addendum '%s' applied before this line: %s"), - $filename, $outline) - if ($self->verbose() > 1 || $self->debug()); - push @newres,$content; - push @newres,$line; - } else { - print wrap_msg(dgettext("po4a", - "Addendum '%s' applied after the line: %s."), - $filename, $outline) - if ($self->verbose() > 1 || $self->debug()); - push @newres,$line; - push @newres,$content; - } - } else { - print wrap_msg(dgettext("po4a", "Addendum '%s' applied at the end of the file."), $filename) - if ($self->verbose() > 1 || $self->debug()); - push @newres,$content; - } - } - } while (scalar @{$self->{TT}{doc_out}}); - @{$self->{TT}{doc_out}} = @newres; + if ($line =~ m/$position/) { + while ($line=shift @{$self->{TT}{doc_out}}) { + last if ($line=~/$boundary/); + push @newres,$line; + } + if (defined $line) { + if ($bmode eq 'before') { + print wrap_msg(dgettext("po4a", + "Addendum '%s' applied before this line: %s"), + $filename, $outline) + if ($self->verbose() > 1 || $self->debug()); + push @newres,$content; + push @newres,$line; + } else { + print wrap_msg(dgettext("po4a", + "Addendum '%s' applied after the line: %s."), + $filename, $outline) + if ($self->verbose() > 1 || $self->debug()); + push @newres,$line; + push @newres,$content; + } + } else { + print wrap_msg(dgettext("po4a", "Addendum '%s' applied at the end of the file."), $filename) + if ($self->verbose() > 1 || $self->debug()); + push @newres,$content; + } + } + } while (scalar @{$self->{TT}{doc_out}}); + @{$self->{TT}{doc_out}} = @newres; } print STDERR "done.\n" if $self->debug(); return 1; @@ -739,12 +740,12 @@ sub shiftline { my ($line,$ref)=(shift @{$_[0]->{TT}{doc_in}}, - shift @{$_[0]->{TT}{doc_in}}); + shift @{$_[0]->{TT}{doc_in}}); return ($line,$ref); } sub unshiftline { - my $self = shift; - unshift @{$self->{TT}{doc_in}},@_; + my $self = shift; + unshift @{$self->{TT}{doc_in}},@_; } sub pushline { push @{$_[0]->{TT}{doc_out}}, $_[1] if defined $_[1]; } @@ -782,7 +783,7 @@ a hash. For example: $self->translate("string","ref","type", - 'wrap' => 1); + 'wrap' => 1); =over @@ -838,29 +839,29 @@ # map { $validoption{$_}=1 } (split(/ /,$validoption)); # foreach (keys %options) { - # Carp::confess "internal error: translate() called with unknown arg $_. Valid options: $validoption" - # unless $validoption{$_}; + # Carp::confess "internal error: translate() called with unknown arg $_. Valid options: $validoption" + # unless $validoption{$_}; # } my $in_charset; if ($self->{TT}{ascii_input}) { - $in_charset = "ascii"; + $in_charset = "ascii"; } else { - if (defined($self->{TT}{'file_in_charset'}) and - length($self->{TT}{'file_in_charset'}) and - $self->{TT}{'file_in_charset'} !~ m/ascii/i) { - $in_charset=$self->{TT}{'file_in_charset'}; - } else { - # FYI, the document charset have to be determined *before* we see the first - # string to recode. - die wrap_mod("po4a", dgettext("po4a", "Couldn't determine the input document's charset. Please specify it on the command line. (non-ASCII char at %s)"), $self->{TT}{non_ascii_ref}) - } + if (defined($self->{TT}{'file_in_charset'}) and + length($self->{TT}{'file_in_charset'}) and + $self->{TT}{'file_in_charset'} !~ m/ascii/i) { + $in_charset=$self->{TT}{'file_in_charset'}; + } else { + # FYI, the document charset have to be determined *before* we see the first + # string to recode. + die wrap_mod("po4a", dgettext("po4a", "Couldn't determine the input document's charset. Please specify it on the command line. (non-ASCII char at %s)"), $self->{TT}{non_ascii_ref}) + } } if ($self->{TT}{po_in}->get_charset ne "CHARSET") { - $string = encode_from_to($string, - $self->{TT}{'file_in_encoder'}, - $self->{TT}{po_in}{encoder}); + $string = encode_from_to($string, + $self->{TT}{'file_in_encoder'}, + $self->{TT}{po_in}{encoder}); } if (defined $options{'wrapcol'} && $options{'wrapcol'} < 0) { @@ -868,51 +869,51 @@ $options{'wrapcol'} = 76 + $options{'wrapcol'}; } my $transstring = $self->{TT}{po_in}->gettext($string, - 'wrap' => $options{'wrap'}||0, - 'wrapcol' => $options{'wrapcol'}); + 'wrap' => $options{'wrap'}||0, + 'wrapcol' => $options{'wrapcol'}); if ($self->{TT}{po_in}->get_charset ne "CHARSET") { - my $out_encoder = $self->{TT}{'file_out_encoder'}; - unless (defined $out_encoder) { - $out_encoder = find_encoding($self->get_out_charset) - } - $transstring = encode_from_to($transstring, - $self->{TT}{po_in}{encoder}, - $out_encoder); + my $out_encoder = $self->{TT}{'file_out_encoder'}; + unless (defined $out_encoder) { + $out_encoder = find_encoding($self->get_out_charset) + } + $transstring = encode_from_to($transstring, + $self->{TT}{po_in}{encoder}, + $out_encoder); } # If the input document isn't completely in ascii, we should see what to # do with the current string unless ($self->{TT}{ascii_input}) { my $out_charset = $self->{TT}{po_out}->get_charset; - # We set the output po charset + # We set the output po charset if ($out_charset eq "CHARSET") { - if ($self->{TT}{utf_mode}) { - $out_charset="UTF-8"; - } else { - $out_charset=$in_charset; - } - $self->{TT}{po_out}->set_charset($out_charset); - } - if ( $in_charset !~ /^$out_charset$/i ) { - Encode::from_to($string,$in_charset,$out_charset); - if (defined($options{'comment'}) and length($options{'comment'})) { - Encode::from_to($options{'comment'},$in_charset,$out_charset); - } - } + if ($self->{TT}{utf_mode}) { + $out_charset="UTF-8"; + } else { + $out_charset=$in_charset; + } + $self->{TT}{po_out}->set_charset($out_charset); + } + if ( $in_charset !~ /^$out_charset$/i ) { + Encode::from_to($string,$in_charset,$out_charset); + if (defined($options{'comment'}) and length($options{'comment'})) { + Encode::from_to($options{'comment'},$in_charset,$out_charset); + } + } } # the comments provided by the modules are automatic comments from the PO point of view $self->{TT}{po_out}->push('msgid' => $string, - 'reference' => $ref, - 'type' => $type, - 'automatic' => $options{'comment'}, - 'wrap' => $options{'wrap'}||0, - 'wrapcol' => $options{'wrapcol'}); + 'reference' => $ref, + 'type' => $type, + 'automatic' => $options{'comment'}, + 'wrap' => $options{'wrap'}||0, + 'wrapcol' => $options{'wrapcol'}); # if ($self->{TT}{po_in}->get_charset ne "CHARSET") { -# Encode::from_to($transstring,$self->{TT}{po_in}->get_charset, -# $self->get_out_charset); +# Encode::from_to($transstring,$self->{TT}{po_in}->get_charset, +# $self->get_out_charset); # } if ($options{'wrap'}||0) { @@ -938,9 +939,9 @@ sub verbose { if (defined $_[1]) { - $_[0]->{TT}{verbose} = $_[1]; + $_[0]->{TT}{verbose} = $_[1]; } else { - return $_[0]->{TT}{verbose} || 0; # undef and 0 have the same meaning, but one generates warnings + return $_[0]->{TT}{verbose} || 0; # undef and 0 have the same meaning, but one generates warnings } } @@ -980,7 +981,7 @@ if (defined $self->{TT}{'file_in_charset'} and length $self->{TT}{'file_in_charset'} and $self->{TT}{'file_in_charset'} !~ m/ascii/i) { - $self->{TT}{ascii_input}=0; + $self->{TT}{ascii_input}=0; } } @@ -1003,20 +1004,20 @@ # Use the value specified at the command line if (defined($self->{TT}{'file_out_charset'}) and - length($self->{TT}{'file_out_charset'})) { - $charset=$self->{TT}{'file_out_charset'}; + length($self->{TT}{'file_out_charset'})) { + $charset=$self->{TT}{'file_out_charset'}; } else { - if ($self->{TT}{utf_mode} && $self->{TT}{ascii_input}) { - $charset="UTF-8"; - } else { - $charset=$self->{TT}{po_in}->get_charset; - $charset=$self->{TT}{'file_in_charset'} - if $charset eq "CHARSET" and - defined($self->{TT}{'file_in_charset'}) and - length($self->{TT}{'file_in_charset'}); - $charset="ascii" - if $charset eq "CHARSET"; - } + if ($self->{TT}{utf_mode} && $self->{TT}{ascii_input}) { + $charset="UTF-8"; + } else { + $charset=$self->{TT}{po_in}->get_charset; + $charset=$self->{TT}{'file_in_charset'} + if $charset eq "CHARSET" and + defined($self->{TT}{'file_in_charset'}) and + length($self->{TT}{'file_in_charset'}); + $charset="ascii" + if $charset eq "CHARSET"; + } } return $charset; } @@ -1034,14 +1035,14 @@ sub recode_skipped_text { my ($self,$text)=(shift,shift); unless ($self->{TT}{'ascii_input'}) { - if(defined($self->{TT}{'file_in_charset'}) and - length($self->{TT}{'file_in_charset'}) ) { - $text = encode_from_to($text, - $self->{TT}{'file_in_encoder'}, - find_encoding($self->get_out_charset)); - } else { - die wrap_mod("po4a", dgettext("po4a", "Couldn't determine the input document's charset. Please specify it on the command line. (non-ASCII char at %s)"), $self->{TT}{non_ascii_ref}) - } + if(defined($self->{TT}{'file_in_charset'}) and + length($self->{TT}{'file_in_charset'}) ) { + $text = encode_from_to($text, + $self->{TT}{'file_in_encoder'}, + find_encoding($self->get_out_charset)); + } else { + die wrap_mod("po4a", dgettext("po4a", "Couldn't determine the input document's charset. Please specify it on the command line. (non-ASCII char at %s)"), $self->{TT}{non_ascii_ref}) + } } return $text; } @@ -1104,8 +1105,8 @@ all language, using a map-like syntax: $self->pushline_all({ "Description[".$langcode."]=". - $self->translate($line,$ref,$langcode) - }); + $self->translate($line,$ref,$langcode) + }); =back Index: trunk/package/bin/po4a/lib/Locale/Po4a/Common.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/Common.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/Common.pm (revision 2380) @@ -76,7 +76,6 @@ eval ' sub wrapi18n($$$) { Text::WrapI18N::wrap($_[0],$_[1],$_[2]) } ' } else { - # If we cannot wrap, well, that's too bad. Survive anyway. eval ' sub wrapi18n($$$) { $_[0].$_[2] } ' } @@ -105,13 +104,13 @@ my $name = shift; print sprintf(gettext( - "%s version %s.\n". - "written by Martin Quinson and Denis Barbier.\n\n". - "Copyright (C) 2002, 2003, 2004 Software in the Public Interest, Inc.\n". - "This is free software; see source code for copying\n". - "conditions. There is NO warranty; not even for\n". - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - ), $name, $Locale::Po4a::TransTractor::VERSION)."\n"; + "%s version %s.\n". + "written by Martin Quinson and Denis Barbier.\n\n". + "Copyright (C) 2002, 2003, 2004 Software in the Public Interest, Inc.\n". + "This is free software; see source code for copying\n". + "conditions. There is NO warranty; not even for\n". + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + ), $name, $Locale::Po4a::TransTractor::VERSION)."\n"; } =item @@ -165,13 +164,13 @@ my @args = @_; if (!$mod) { - # If we don't get a module name, show the message like wrap_mod does - return wrap_mod($ref, $msg, @args); + # If we don't get a module name, show the message like wrap_mod does + return wrap_mod($ref, $msg, @args); } else { - $ref .= ": "; - my $spaces = " " x min(length($ref), 15); - $msg = "$ref($mod)\n$msg"; - return wrapi18n("", $spaces, sprintf($msg, @args))."\n"; + $ref .= ": "; + my $spaces = " " x min(length($ref), 15); + $msg = "$ref($mod)\n$msg"; + return wrapi18n("", $spaces, sprintf($msg, @args))."\n"; } } Index: trunk/package/bin/po4a/lib/Locale/Po4a/TeX.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/TeX.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/TeX.pm (revision 2380) @@ -730,7 +730,6 @@ $buffer =~ s/($RE_PRE_COMMENT)$RE_COMMENT([^\n]*)(\n[ \t]*)/$1$end/s; } - # translate leading commands. do { # keep the leading space to put them back after the translation of Index: trunk/package/bin/po4a/lib/Locale/Po4a/Chooser.pm =================================================================== --- trunk/package/bin/po4a/lib/Locale/Po4a/Chooser.pm (revision 2379) +++ trunk/package/bin/po4a/lib/Locale/Po4a/Chooser.pm (revision 2380) @@ -45,9 +45,9 @@ if ($@) { my $error=$@; warn wrap_msg(gettext("Unknown format type: %s."), $module); - warn wrap_mod("po4a::chooser", - gettext("Module loading error: %s"), $error) - if defined $options{'verbose'} && $options{'verbose'} > 0; + warn wrap_mod("po4a::chooser", + gettext("Module loading error: %s"), $error) + if defined $options{'verbose'} && $options{'verbose'} > 0; list(1); } } Index: trunk/package/bin/po4a/po4a-gettextize =================================================================== --- trunk/package/bin/po4a/po4a-gettextize (revision 2379) +++ trunk/package/bin/po4a/po4a-gettextize (revision 2380) @@ -186,7 +186,7 @@ my ($pofile)=('-'); my (@masterfile,@locfile,$help_fmt,$help,$type,@options); -my ($mastchar,$locchar); +my ($mastchar,$locchar)=('ascii'); Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev'); GetOptions( 'help|h' => \$help, @@ -238,7 +238,12 @@ $mastertt->read($file); } $mastertt->{TT}{utf_mode} = 1; -$mastertt->{TT}{file_in_charset} = $mastchar; +if ($mastertt->{TT}{ascii_input}) { + $mastertt->detected_charset('ascii'); +} else { + $mastertt->detected_charset($mastchar); + $mastertt->{TT}{po_in}->set_charset($mastchar); +} $mastertt->parse; @@ -253,7 +258,8 @@ } # We force the conversion to utf if the master document wasn't in ascii $transtt->{TT}{utf_mode} = !$mastertt->{TT}{ascii_input}; - $transtt->{TT}{file_in_charset} = $locchar; + $transtt->detected_charset($locchar); + $transtt->{TT}{po_in}->set_charset($locchar); $transtt->parse; my $mergedpo = Locale::Po4a::Po->gettextize($mastertt->getpoout(), Index: trunk/package/po/es.po =================================================================== --- trunk/package/po/es.po (revision 2379) +++ trunk/package/po/es.po (revision 2380) @@ -8,8 +8,8 @@ "Project-Id-Version: Chameleon 2.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-27 13:32+0000\n" -"PO-Revision-Date: 2013-12-29 12:07+0000\n" -"Last-Translator: Maniac \n" +"PO-Revision-Date: 2014-05-19 21:55+0000\n" +"Last-Translator: Yllelder \n" "Language-Team: es \n" "Language: es\n" "MIME-Version: 1.0\n" @@ -17,7 +17,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Pootle 2.5.0-rc1\n" -"X-POOTLE-MTIME: 1388318845.0\n" +"X-POOTLE-MTIME: 1400536515.0\n" #. type: Content of:

#: Resources/templates/Welcome.html:22 @@ -453,6 +453,12 @@ "*Removes a panic in commpage_stuff_routine\n" "Dependencies: none" msgstr "" +"El módulo KernelPatcher proporciona parches para lo siguiente:\n" +"*Habilita el uso del kernelcache con /Extra/Extensions y /Extra/Extensions.mkext\n" +"*Elimina el chequeo de CPUID\n" +"*Elimina un LAPIC panic\n" +"*Elimina un panic en commpage_stuff_routine\n" +"Dependencias: ninguna" #. type: "KextPatcher_title" #: Resources/templates/Localizable.strings:79 @@ -467,6 +473,8 @@ "The KextPatcher module provides patches for the following:\n" "Dependencies: none" msgstr "" +"El módulo KextPatcher proporciona parches para lo siguiente:\n" +"Dependencias: ninguna" #. type: "NVIDIAGraphicsEnabler_title" #: Resources/templates/Localizable.strings:83 @@ -481,6 +489,8 @@ "The GraphicsEnabler nVidia code ported to a module.\n" "Dependencies: none" msgstr "" +"El código de GraphicsEnabler nVidia ha sido portado a un módulo.\n" +"Dependencias: ninguna" #. type: "AMDGraphicsEnabler_title" #: Resources/templates/Localizable.strings:87 @@ -495,6 +505,8 @@ "The GraphicsEnabler AMD/ATi code ported to a module.\n" "Dependencies: none" msgstr "" +"El código de GraphicsEnabler AMD/ATi ha sido portado a un módulo.\n" +"Dependencias: ninguna" #. type: "IntelGraphicsEnabler_title" #: Resources/templates/Localizable.strings:91 @@ -509,6 +521,8 @@ "The GraphicsEnabler gma(Intel) code ported to a module.\n" "Dependencies: none" msgstr "" +"El código de GraphicsEnabler gma(Intel) ha sido portado a un módulo.\n" +"Dependencias: ninguna" #. type: "Options_title" #: Resources/templates/Localizable.strings:100 @@ -688,7 +702,7 @@ #: Resources/templates/Localizable.strings:145 #, no-wrap msgid "Force SMBIOS Table 17 to be 27 bytes long." -msgstr "" +msgstr "Fuerza a SMBIOS Table 17 a ser de 27 bytes de largo." #. type: "RestartFix_title" #: Resources/templates/Localizable.strings:147 @@ -832,7 +846,7 @@ #: Resources/templates/Localizable.strings:183 #, no-wrap msgid "Discard the motherboard's built-in DMAR table, this key action resolve the problem with VT-d panics." -msgstr "" +msgstr "Descarta la tabla DMAR integrada en la placa base, esta acción clave resuelve el problema con VT-d panics." #. type: "EnableC2State_title" #: Resources/templates/Localizable.strings:185 @@ -1732,7 +1746,7 @@ #: Resources/templates/Localizable.strings:446 #, no-wrap msgid "Set 01660000 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660000 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix01_title" #: Resources/templates/Localizable.strings:448 @@ -1744,7 +1758,7 @@ #: Resources/templates/Localizable.strings:449 #, no-wrap msgid "Set 01660001 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660001 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix02_title" #: Resources/templates/Localizable.strings:451 @@ -1756,7 +1770,7 @@ #: Resources/templates/Localizable.strings:452 #, no-wrap msgid "Set 01660002 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660002 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix03_title" #: Resources/templates/Localizable.strings:454 @@ -1768,7 +1782,7 @@ #: Resources/templates/Localizable.strings:455 #, no-wrap msgid "Set 01660003 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660003 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix04_title" #: Resources/templates/Localizable.strings:457 @@ -1780,7 +1794,7 @@ #: Resources/templates/Localizable.strings:458 #, no-wrap msgid "Set 01660004 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660004 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix05_title" #: Resources/templates/Localizable.strings:460 @@ -1792,7 +1806,7 @@ #: Resources/templates/Localizable.strings:461 #, no-wrap msgid "Set 01620005 for Intel HD4000 (Desktop) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01620005 para Intel HD4000 (Desktop) AAPL,ig-platform-id ." #. type: "IntelCaprix06_title" #: Resources/templates/Localizable.strings:463 @@ -1804,7 +1818,7 @@ #: Resources/templates/Localizable.strings:464 #, no-wrap msgid "Set 01620006 for Intel HD4000 (Desktop) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01620006 para Intel HD4000 (Desktop) AAPL,ig-platform-id ." #. type: "IntelCaprix07_title" #: Resources/templates/Localizable.strings:466 @@ -1816,7 +1830,7 @@ #: Resources/templates/Localizable.strings:467 #, no-wrap msgid "Set 01620007 for Intel HD4000 (Desktop) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01620007 para Intel HD4000 (Desktop) AAPL,ig-platform-id ." #. type: "IntelCaprix08_title" #: Resources/templates/Localizable.strings:469 @@ -1828,7 +1842,7 @@ #: Resources/templates/Localizable.strings:470 #, no-wrap msgid "Set 01660008 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660008 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix09_title" #: Resources/templates/Localizable.strings:472 @@ -1840,7 +1854,7 @@ #: Resources/templates/Localizable.strings:473 #, no-wrap msgid "Set 01660009 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 01660009 para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix10_title" #: Resources/templates/Localizable.strings:475 @@ -1852,7 +1866,7 @@ #: Resources/templates/Localizable.strings:476 #, no-wrap msgid "Set 0166000a for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 0166000a para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelCaprix11_title" #: Resources/templates/Localizable.strings:478 @@ -1864,7 +1878,7 @@ #: Resources/templates/Localizable.strings:479 #, no-wrap msgid "Set 0166000b for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Establece 0166000b para Intel HD4000 (Mobile) AAPL,ig-platform-id ." #. type: "IntelAzulx00_title" #: Resources/templates/Localizable.strings:483 @@ -1876,7 +1890,7 @@ #: Resources/templates/Localizable.strings:484 #, no-wrap msgid "Set 00000604 for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 00000604 para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx01_title" #: Resources/templates/Localizable.strings:486 @@ -1888,7 +1902,7 @@ #: Resources/templates/Localizable.strings:487 #, no-wrap msgid "Set 0000060c for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0000060c para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx02_title" #: Resources/templates/Localizable.strings:489 @@ -1900,7 +1914,7 @@ #: Resources/templates/Localizable.strings:490 #, no-wrap msgid "Set 00001604 for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 00001604 para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx03_title" #: Resources/templates/Localizable.strings:492 @@ -1912,7 +1926,7 @@ #: Resources/templates/Localizable.strings:493 #, no-wrap msgid "Set 0000160a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0000160a para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx04_title" #: Resources/templates/Localizable.strings:495 @@ -1924,7 +1938,7 @@ #: Resources/templates/Localizable.strings:496 #, no-wrap msgid "Set 0000160c for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0000160c para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx05_title" #: Resources/templates/Localizable.strings:498 @@ -1936,7 +1950,7 @@ #: Resources/templates/Localizable.strings:499 #, no-wrap msgid "Set 00002604 for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 00002604 para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx06_title" #: Resources/templates/Localizable.strings:501 @@ -1948,7 +1962,7 @@ #: Resources/templates/Localizable.strings:502 #, no-wrap msgid "Set 0000260a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0000260a para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx07_title" #: Resources/templates/Localizable.strings:504 @@ -1960,7 +1974,7 @@ #: Resources/templates/Localizable.strings:505 #, no-wrap msgid "Set 0600260c for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0600260c para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx08_title" #: Resources/templates/Localizable.strings:507 @@ -1972,7 +1986,7 @@ #: Resources/templates/Localizable.strings:508 #, no-wrap msgid "Set 0000260d for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0000260d para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx09_title" #: Resources/templates/Localizable.strings:510 @@ -1984,7 +1998,7 @@ #: Resources/templates/Localizable.strings:511 #, no-wrap msgid "Set 02001604 for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 02001604 para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx10_title" #: Resources/templates/Localizable.strings:513 @@ -1996,7 +2010,7 @@ #: Resources/templates/Localizable.strings:514 #, no-wrap msgid "Set 0300220d for Intel HD5000 (Desktop) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0300220d para Intel Haswell (Desktop) AAPL,ig-platform-id." #. type: "IntelAzulx11_title" #: Resources/templates/Localizable.strings:516 @@ -2008,7 +2022,7 @@ #: Resources/templates/Localizable.strings:517 #, no-wrap msgid "Set 0500260a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0500260a para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx12_title" #: Resources/templates/Localizable.strings:519 @@ -2020,7 +2034,7 @@ #: Resources/templates/Localizable.strings:520 #, no-wrap msgid "Set 0600260a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0600260a para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx13_title" #: Resources/templates/Localizable.strings:522 @@ -2032,7 +2046,7 @@ #: Resources/templates/Localizable.strings:523 #, no-wrap msgid "Set 0700260d for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0700260d para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx14_title" #: Resources/templates/Localizable.strings:525 @@ -2044,7 +2058,7 @@ #: Resources/templates/Localizable.strings:526 #, no-wrap msgid "Set 0800260a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 0800260a para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx15_title" #: Resources/templates/Localizable.strings:528 @@ -2056,7 +2070,7 @@ #: Resources/templates/Localizable.strings:529 #, no-wrap msgid "Set 08002e0a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Establece 08002e0a para Intel Haswell (Mobile) AAPL,ig-platform-id." #. type: "AD2000B_PinConf_title" #: Resources/templates/Localizable.strings:533 @@ -2200,7 +2214,7 @@ #: Resources/templates/Localizable.strings:569 #, no-wrap msgid "Skip the GraphicsEnbaler autodetect for Intel based GPUs." -msgstr "" +msgstr "Saltar la detección automática de GraphicsEnabler para GPUs basados ​​en Intel." #. type: "SkipNvidiaGfx_title" #: Resources/templates/Localizable.strings:571 @@ -2212,7 +2226,7 @@ #: Resources/templates/Localizable.strings:572 #, no-wrap msgid "Skip the GraphicsEnbaler autodetect for NVIDIA based GPUs." -msgstr "" +msgstr "Saltar la detección automática de GraphicsEnabler para GPUs basados ​​en nVIDIA." #. type: "SkipAtiGfx_title" #: Resources/templates/Localizable.strings:574 @@ -2224,7 +2238,7 @@ #: Resources/templates/Localizable.strings:575 #, no-wrap msgid "Skip the GraphicsEnbaler autodetect for AMD/ATI based GPUs." -msgstr "" +msgstr "Saltar la detección automática de GraphicsEnabler para GPUs basados ​​en AMD/ATI." #. type: "EnableBacklight_title" #: Resources/templates/Localizable.strings:577 @@ -2236,7 +2250,7 @@ #: Resources/templates/Localizable.strings:578 #, no-wrap msgid "Enables Backlight options for laptop with nVidia cards." -msgstr "" +msgstr "Habilita la iluminación de fondo para portátiles con tarjetas nVIDIA." #. type: "EnableDualLink_title" #: Resources/templates/Localizable.strings:580 @@ -2248,7 +2262,7 @@ #: Resources/templates/Localizable.strings:581 #, no-wrap msgid "Enables DualLink options for nVidia and ATi cards." -msgstr "" +msgstr "Habilitar las opciones de DualLink para tarjetas nVIDIA y ATi." #. type: "Verbose_title" #: Resources/templates/Localizable.strings:587 @@ -2324,6 +2338,9 @@ "http://www.insanelymac.com/forum/topic/280062-waiting-for-root-device-when-kernel-cache-used-only-with-some-disks-fix/\n" "Findings credits to bcc9." msgstr "" +"Info aquí: Waiting for root device when kernel cache used only with some disks +CORREGIDO\n" +"http://www.insanelymac.com/forum/topic/280062-waiting-for-root-device-when-kernel-cache-used-only-with-some-disks-fix/\n" +"Agradecimientos a bcc9." #. type: "Darkwake_title" #: Resources/templates/Localizable.strings:607 @@ -2352,6 +2369,10 @@ "http://www.insanelymac.com/forum/topic/288582-new-nvidia-retail-driver-install-solution/\n" "Findings credits to meklort and Rampage Dev." msgstr "" +"Introduce un nuevo Panel de Preferencias en Preferencias del Sistema que permite habilitar el Nvidia Web Driver.\n" +"Info aquí: New Nvidia Retail Driver Install Solution\n" +"http://www.insanelymac.com/forum/topic/288582-new-nvidia-retail-driver-install-solution/\n" +"Agradecimientos a meklort y a Rampage Dev." #. type: "Dart0_title" #: Resources/templates/Localizable.strings:616 @@ -2366,6 +2387,8 @@ "Avoiding the DMAR processing causing by VT-d function in Osx (Virtualization).\n" "More information by bcc9 here: http://www.insanelymac.com/forum/topic/282989-vtd0-fault-after-1082-google-hasnt-heard-of-it-any-help/#entry1867000" msgstr "" +"Evitar el procesamiento de DMAR causado por VT-d function en Osx (Virtualization).\n" +"Más información por bcc9 aquí: http://www.insanelymac.com/forum/topic/282989-vtd0-fault-after-1082-google-hasnt-heard-of-it-any-help/#entry1867000" #. type: "mac-de_title" #: Resources/templates/Localizable.strings:624 @@ -2557,7 +2580,7 @@ #: Resources/templates/Localizable.strings:691 #, no-wrap msgid "Set one HDEF Layout ID to use for your HDA controller." -msgstr "" +msgstr "Establece un HDEF Layout ID a usar por tu controlador HDA." #. type: "HDAULayout_title" #: Resources/templates/Localizable.strings:694 @@ -2593,7 +2616,7 @@ #: Resources/templates/Localizable.strings:703 #, no-wrap msgid "Set one AAPL,ig-platform-id to use for your Intel HD5000." -msgstr "" +msgstr "Establecer un AAPL,ig-platform-id a usar por tu Intel Haswell." #. type: "HDEFPinConfiguration_title" #: Resources/templates/Localizable.strings:706 @@ -2605,7 +2628,7 @@ #: Resources/templates/Localizable.strings:707 #, no-wrap msgid "Set one HDEF PinConfiguration to use." -msgstr "" +msgstr "Establecer un HDEF PinConfiguration a usar." #. type: "Video_title" #: Resources/templates/Localizable.strings:710 Index: trunk/package/po/ru.po =================================================================== --- trunk/package/po/ru.po (revision 2379) +++ trunk/package/po/ru.po (revision 2380) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Chameleon 2.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-27 13:32+0000\n" +"POT-Creation-Date: 2013-12-27 14:14+0000\n" "PO-Revision-Date: 2013-06-27 21:13+0000\n" "Last-Translator: ltodoto \n" "Language-Team: ru \n" @@ -671,16 +671,15 @@ #. type: "ForceFullMemInfo_title" #: Resources/templates/Localizable.strings:144 -#, fuzzy, no-wrap -#| msgid "ForceWake=Yes" +#, no-wrap msgid "ForceFullMemInfo=Yes" -msgstr "ForceWake=Yes" +msgstr "ForceFullMemInfo=Yes" #. type: "ForceFullMemInfo_description" #: Resources/templates/Localizable.strings:145 #, no-wrap msgid "Force SMBIOS Table 17 to be 27 bytes long." -msgstr "" +msgstr "Принудительно установить размер 17-й таблицы SMBIOS равным 27 байтам." #. type: "RestartFix_title" #: Resources/templates/Localizable.strings:147 @@ -1185,6 +1184,8 @@ "Set HDEF layout-it to 99:\n" "063 (0x63, 0x00, 0x00, 0x00)." msgstr "" +"Установить значение HDEF layout-it равным 99:\n" +"063 (0x63, 0x00, 0x00, 0x00)." #. type: "HDAULayoutIDx269_title" #: Resources/templates/Localizable.strings:281 @@ -1199,7 +1200,7 @@ msgid "" "Set HDEF layout-it to 269:\n" "10D (0x0D, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 269" #. type: "HDAULayoutIDx387_title" #: Resources/templates/Localizable.strings:285 @@ -1214,7 +1215,7 @@ msgid "" "Set HDEF layout-it to 387:\n" "183 (0x83, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 387" #. type: "HDAULayoutIDx388_title" #: Resources/templates/Localizable.strings:289 @@ -1229,7 +1230,7 @@ msgid "" "Set HDEF layout-it to 388:\n" "184 (0x84, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 388" #. type: "HDAULayoutIDx389_title" #: Resources/templates/Localizable.strings:293 @@ -1244,7 +1245,7 @@ msgid "" "Set HDEF layout-it to 389:\n" "185 (0x85, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 389" #. type: "HDAULayoutIDx392_title" #: Resources/templates/Localizable.strings:297 @@ -1259,7 +1260,7 @@ msgid "" "Set HDEF layout-it to 392:\n" "188 (0x88, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 392" #. type: "HDAULayoutIDx398_title" #: Resources/templates/Localizable.strings:301 @@ -1274,7 +1275,7 @@ msgid "" "Set HDEF layout-it to 398:\n" "18E (0x8E, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 398" #. type: "HDAULayoutIDx662_title" #: Resources/templates/Localizable.strings:305 @@ -1289,7 +1290,7 @@ msgid "" "Set HDEF layout-it to 662:\n" "296 (0x96, 0x02, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 662" #. type: "HDAULayoutIDx663_title" #: Resources/templates/Localizable.strings:309 @@ -1304,7 +1305,7 @@ msgid "" "Set HDEF layout-it to 663:\n" "297 (0x97, 0x02, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 663" #. type: "HDAULayoutIDx664_title" #: Resources/templates/Localizable.strings:313 @@ -1319,7 +1320,7 @@ msgid "" "Set HDEF layout-it to 664:\n" "298 (0x98, 0x02, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 664" #. type: "HDAULayoutIDx885_title" #: Resources/templates/Localizable.strings:317 @@ -1334,7 +1335,7 @@ msgid "" "Set HDEF layout-it to 885:\n" "375 (0x75, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 885" #. type: "HDAULayoutIDx887_title" #: Resources/templates/Localizable.strings:321 @@ -1349,7 +1350,7 @@ msgid "" "Set HDEF layout-it to 887:\n" "377 (0x77, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 887" #. type: "HDAULayoutIDx888_title" #: Resources/templates/Localizable.strings:325 @@ -1364,7 +1365,7 @@ msgid "" "Set HDEF layout-it to 888:\n" "378 (0x78, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 888" #. type: "HDAULayoutIDx889_title" #: Resources/templates/Localizable.strings:329 @@ -1379,7 +1380,7 @@ msgid "" "Set HDEF layout-it to 889:\n" "379 (0x79, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 889" #. type: "HDAULayoutIDx892_title" #: Resources/templates/Localizable.strings:333 @@ -1394,7 +1395,7 @@ msgid "" "Set HDEF layout-it to 892:\n" "37C (0x7C, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 892" #. type: "HDAULayoutIDx898_title" #: Resources/templates/Localizable.strings:337 @@ -1409,7 +1410,7 @@ msgid "" "Set HDEF layout-it to 898:\n" "382 (0x82, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDEF layout-it равным 898" #. type: "HDAULayoutIDxBD7_title" #: Resources/templates/Localizable.strings:341 @@ -1504,7 +1505,7 @@ msgid "" "Set HDAU layout-it to 387:\n" "183 (0x83, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 387" #. type: "HDAULayoutIDx388_description" #: Resources/templates/Localizable.strings:388 @@ -1512,7 +1513,7 @@ msgid "" "Set HDAU layout-it to 388:\n" "184 (0x84, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 388" #. type: "HDAULayoutIDx389_description" #: Resources/templates/Localizable.strings:392 @@ -1520,7 +1521,7 @@ msgid "" "Set HDAU layout-it to 389:\n" "185 (0x85, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 389" #. type: "HDAULayoutIDx392_description" #: Resources/templates/Localizable.strings:396 @@ -1528,7 +1529,7 @@ msgid "" "Set HDAU layout-it to 392:\n" "188 (0x88, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 392" #. type: "HDAULayoutIDx398_description" #: Resources/templates/Localizable.strings:400 @@ -1536,7 +1537,7 @@ msgid "" "Set HDAU layout-it to 398:\n" "18E (0x8E, 0x01, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 398" #. type: "HDAULayoutIDx662_description" #: Resources/templates/Localizable.strings:404 @@ -1544,7 +1545,7 @@ msgid "" "Set HDAU layout-it to 662:\n" "296 (0x96, 0x02, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 662" #. type: "HDAULayoutIDx663_description" #: Resources/templates/Localizable.strings:408 @@ -1552,7 +1553,7 @@ msgid "" "Set HDAU layout-it to 663:\n" "297 (0x97, 0x02, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 663" #. type: "HDAULayoutIDx664_description" #: Resources/templates/Localizable.strings:412 @@ -1560,7 +1561,7 @@ msgid "" "Set HDAU layout-it to 664:\n" "298 (0x98, 0x02, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 664" #. type: "HDAULayoutIDx885_description" #: Resources/templates/Localizable.strings:416 @@ -1568,7 +1569,7 @@ msgid "" "Set HDAU layout-it to 885:\n" "375 (0x75, 0x03, 0x00, 0x00)." -msgstr "" +msgstr "Установить значение HDAU layout-it равным 885" #. type: "HDAULayoutIDx887_description" #: Resources/templates/Localizable.strings:420 @@ -1664,7 +1665,7 @@ #: Resources/templates/Localizable.strings:455 #, no-wrap msgid "Set 01660003 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01660003 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix04_title" #: Resources/templates/Localizable.strings:457 @@ -1676,7 +1677,7 @@ #: Resources/templates/Localizable.strings:458 #, no-wrap msgid "Set 01660004 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01660004 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix05_title" #: Resources/templates/Localizable.strings:460 @@ -1688,7 +1689,7 @@ #: Resources/templates/Localizable.strings:461 #, no-wrap msgid "Set 01620005 for Intel HD4000 (Desktop) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01620005 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix06_title" #: Resources/templates/Localizable.strings:463 @@ -1700,7 +1701,7 @@ #: Resources/templates/Localizable.strings:464 #, no-wrap msgid "Set 01620006 for Intel HD4000 (Desktop) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01620006 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix07_title" #: Resources/templates/Localizable.strings:466 @@ -1712,7 +1713,7 @@ #: Resources/templates/Localizable.strings:467 #, no-wrap msgid "Set 01620007 for Intel HD4000 (Desktop) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01620007 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix08_title" #: Resources/templates/Localizable.strings:469 @@ -1724,7 +1725,7 @@ #: Resources/templates/Localizable.strings:470 #, no-wrap msgid "Set 01660008 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01660008 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix09_title" #: Resources/templates/Localizable.strings:472 @@ -1736,7 +1737,7 @@ #: Resources/templates/Localizable.strings:473 #, no-wrap msgid "Set 01660009 for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 01660009 в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix10_title" #: Resources/templates/Localizable.strings:475 @@ -1748,7 +1749,7 @@ #: Resources/templates/Localizable.strings:476 #, no-wrap msgid "Set 0166000a for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 0166000a в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelCaprix11_title" #: Resources/templates/Localizable.strings:478 @@ -1760,7 +1761,7 @@ #: Resources/templates/Localizable.strings:479 #, no-wrap msgid "Set 0166000b for Intel HD4000 (Mobile) AAPL,ig-platform-id ." -msgstr "" +msgstr "Установить 0166000b в качестве Intel HD4000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx00_title" #: Resources/templates/Localizable.strings:483 @@ -1825,59 +1826,55 @@ #: Resources/templates/Localizable.strings:496 #, no-wrap msgid "Set 0000160c for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 0166000c в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx05_title" #: Resources/templates/Localizable.strings:498 -#, fuzzy, no-wrap -#| msgid "01660000" +#, no-wrap msgid "00002604" -msgstr "01660000" +msgstr "00002604" #. type: "IntelAzulx05_description" #: Resources/templates/Localizable.strings:499 #, no-wrap msgid "Set 00002604 for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 00002604 в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx06_title" #: Resources/templates/Localizable.strings:501 -#, fuzzy, no-wrap -#| msgid "01660000" +#, no-wrap msgid "0000260a" -msgstr "01660000" +msgstr "0000260a" #. type: "IntelAzulx06_description" #: Resources/templates/Localizable.strings:502 #, no-wrap msgid "Set 0000260a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 0000260a в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx07_title" #: Resources/templates/Localizable.strings:504 -#, fuzzy, no-wrap -#| msgid "01660000" +#, no-wrap msgid "0000260c" -msgstr "01660000" +msgstr "0000260c" #. type: "IntelAzulx07_description" #: Resources/templates/Localizable.strings:505 #, no-wrap msgid "Set 0600260c for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 0000260c в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx08_title" #: Resources/templates/Localizable.strings:507 -#, fuzzy, no-wrap -#| msgid "01660000" +#, no-wrap msgid "0000260d" -msgstr "01660000" +msgstr "0000260d" #. type: "IntelAzulx08_description" #: Resources/templates/Localizable.strings:508 #, no-wrap msgid "Set 0000260d for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 0000260d в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx09_title" #: Resources/templates/Localizable.strings:510 @@ -1937,7 +1934,7 @@ #: Resources/templates/Localizable.strings:523 #, no-wrap msgid "Set 0700260d for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 0000260d в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx14_title" #: Resources/templates/Localizable.strings:525 @@ -1949,7 +1946,7 @@ #: Resources/templates/Localizable.strings:526 #, no-wrap msgid "Set 0800260a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 0000260a в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "IntelAzulx15_title" #: Resources/templates/Localizable.strings:528 @@ -1961,7 +1958,7 @@ #: Resources/templates/Localizable.strings:529 #, no-wrap msgid "Set 08002e0a for Intel HD5000 (Mobile) AAPL,ig-platform-id." -msgstr "" +msgstr "Установить 00002e0a в качестве Intel HD5000 (Mobile) AAPL,ig-platform-id." #. type: "AD2000B_PinConf_title" #: Resources/templates/Localizable.strings:533 @@ -1973,7 +1970,7 @@ #: Resources/templates/Localizable.strings:534 #, no-wrap msgid "Set HDEF PinConfiguration for Analog Devices AD2000b." -msgstr "" +msgstr "Установить HDEF PinConfiguration для Analog Devices AD2000b." #. type: "AD1981HD_PinConf_title" #: Resources/templates/Localizable.strings:536 @@ -1985,7 +1982,7 @@ #: Resources/templates/Localizable.strings:537 #, no-wrap msgid "Set HDEF PinConfiguration for Analog Devices AD1981HD." -msgstr "" +msgstr "Установить HDEF PinConfiguration для Analog Devices AD1981HD." #. type: "AD1988B_PinConf_title" #: Resources/templates/Localizable.strings:539 @@ -1997,7 +1994,7 @@ #: Resources/templates/Localizable.strings:540 #, no-wrap msgid "Set HDEF PinConfiguration for Analog Devices AD1988b." -msgstr "" +msgstr "Установить HDEF PinConfiguration для Analog Devices AD198b." #. type: "ALC888_PinConf_title" #: Resources/templates/Localizable.strings:542 @@ -2009,7 +2006,7 @@ #: Resources/templates/Localizable.strings:543 #, no-wrap msgid "Set HDEF PinConfiguration for Realtek ALC888." -msgstr "" +msgstr "Установить HDEF PinConfiguration для Realtek ALC888." #. type: "ALC1200_PinConf_title" #: Resources/templates/Localizable.strings:545 @@ -2021,7 +2018,7 @@ #: Resources/templates/Localizable.strings:546 #, no-wrap msgid "Set HDEF PinConfiguration for Realtek ALC1200." -msgstr "" +msgstr "Установить HDEF PinConfiguration для Realtek ALC1200." #. type: "00_PinConf_title" #: Resources/templates/Localizable.strings:548 @@ -2033,7 +2030,7 @@ #: Resources/templates/Localizable.strings:549 #, no-wrap msgid "Set HDEF PinConfiguration for ???." -msgstr "" +msgstr "Установить HDEF PinConfiguration для ???." #. type: "GraphicsEnabler_title" #: Resources/templates/Localizable.strings:553 @@ -2500,8 +2497,7 @@ #. type: "IntelAzul_description" #: Resources/templates/Localizable.strings:703 -#, fuzzy, no-wrap -#| msgid "Set one AAPL,ig-platform-id to use for your Intel HD4000." +#, no-wrap msgid "Set one AAPL,ig-platform-id to use for your Intel HD5000." msgstr "Выберите значение AAPL,ig-platform-id, используемое по умолчанию для графического процессора Intel HD4000."