[Po4a-devel][CVS] po4a/debian changelog,1.66,1.67
by Martin Quinson
Update of /cvsroot/po4a/po4a/debian
In directory haydn:/tmp/cvs-serv32222
Modified Files:
changelog
Log Message:
Allow extra space after the semi colon separating fields in addendum headers (may close debian's #263299)
Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/debian/changelog,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- changelog 7 Aug 2004 02:15:07 -0000 1.66
+++ changelog 7 Aug 2004 02:35:18 -0000 1.67
@@ -13,13 +13,15 @@
- Overhaul of po4a(7)
- Various pod fixup
- TransTractor and Po mkdir the path to where they are asked to write
- something if it does not exist. Clauses #263297 (in Debian)
+ something if it does not exist. Closes #263297 (in Debian)
+ - Allow extra space after the semi colon separating fields in addendum
+ headers. Closes #263299 (in Debian, provided that I understood the repport)
[Jordi Vilalta]
- Further pod and english fixup
- Complete teh spanish translation of the documentation
- -- Martin Quinson <martin.quinson(a)tuxfamily.org> Sun, 1 Aug 2004 13:36:08 -0700
+ -- Martin Quinson <martin.quinson(a)tuxfamily.org> Fri, 6 Aug 2004 19:33:01 -0700
po4a (0.17.1-1) unstable; urgency=low
20 years, 3 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a TransTractor.pm,1.29,1.30
by Martin Quinson
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv31940
Modified Files:
TransTractor.pm
Log Message:
Allow extra space after the semi colon separating fields in addendum headers (maybe close debian's #263299, unclear report)
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- TransTractor.pm 7 Aug 2004 02:15:07 -0000 1.29
+++ TransTractor.pm 7 Aug 2004 02:32:50 -0000 1.30
@@ -488,7 +488,7 @@
goto END_PARSE_ADDFILE;
}
foreach my $part (split(/;/,$header)) {
- unless ($part =~ m/^([^=]*)=(.*)$/) {
+ unless ($part =~ m/^\s*([^=]*)=(.*)$/) {
warn sprintf(dgettext("po4a","Syntax error in Po4a header of %s, near \"%s\""),
$filename,$part)."\n";
goto END_PARSE_ADDFILE;
20 years, 3 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a TransTractor.pm,1.28,1.29 Po.pm,1.17,1.18
by Martin Quinson
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv22132/lib/Locale/Po4a
Modified Files:
TransTractor.pm Po.pm
Log Message:
TransTractor and Po mkdir the path to where they are asked to write something if it does not exist. Clauses #263297 (in Debian)
Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Po.pm 6 Aug 2004 22:48:51 -0000 1.17
+++ Po.pm 7 Aug 2004 02:15:07 -0000 1.18
@@ -72,6 +72,7 @@
use Carp qw(croak);
use Locale::gettext qw(dgettext);
+use File::Path; # mkdir before write
my @known_flags=qw(wrap no-wrap c-format fuzzy);
@@ -218,6 +219,13 @@
if ($filename eq '-') {
$fh=\*STDOUT;
} else {
+ # make sure the directory in which we should write the localized file exists
+ my $dir = $filename;
+ $dir =~ s|/[^/]*$||;
+
+ File::Path::mkpath($dir, 0, 0755) # Croaks on error
+ if (length ($dir) && ! -e $dir);
+
open $fh,">$filename"
|| croak (sprintf((dgettext("po4a","Can't write to %s: %s"),$filename,$!))."\n");
}
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- TransTractor.pm 5 Aug 2004 12:19:59 -0000 1.28
+++ TransTractor.pm 7 Aug 2004 02:15:07 -0000 1.29
@@ -20,6 +20,7 @@
use Locale::Po4a::Po;
use Locale::gettext qw(dgettext);
+use File::Path; # mkdir before write
use Encode::Guess;
@@ -378,7 +379,14 @@
if ($filename eq '-') {
$fh=\*STDOUT;
} else {
- open $fh,">$filename"
+ # make sure the directory in which we should write the localized file exists
+ my $dir = $filename;
+ $dir =~ s|/[^/]*$||;
+
+ File::Path::mkpath($dir, 0, 0755) # Croaks on error
+ if (length ($dir) && ! -e $dir);
+
+ open $fh,">$filename"
|| croak (sprintf((dgettext("po4a","can't write to %s: %s"),$filename,$!))."\n");
}
20 years, 3 months
[Po4a-devel][CVS] po4a/debian changelog,1.65,1.66
by Martin Quinson
Update of /cvsroot/po4a/po4a/debian
In directory haydn:/tmp/cvs-serv22132/debian
Modified Files:
changelog
Log Message:
TransTractor and Po mkdir the path to where they are asked to write something if it does not exist. Clauses #263297 (in Debian)
Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/debian/changelog,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- changelog 2 Aug 2004 09:51:35 -0000 1.65
+++ changelog 7 Aug 2004 02:15:07 -0000 1.66
@@ -12,10 +12,12 @@
- Allow entities definition to contain '>'. Closes #262735 (in Debian)
- Overhaul of po4a(7)
- Various pod fixup
+ - TransTractor and Po mkdir the path to where they are asked to write
+ something if it does not exist. Clauses #263297 (in Debian)
[Jordi Vilalta]
- Further pod and english fixup
- - Greatly improve the spanish documentation translation
+ - Complete teh spanish translation of the documentation
-- Martin Quinson <martin.quinson(a)tuxfamily.org> Sun, 1 Aug 2004 13:36:08 -0700
20 years, 3 months
Re: [Po4a-devel][CVS] po4a/lib/Locale/Po4a Po.pm,1.16,1.17
by Martin Quinson
Erm. That's kind of hackish. I know that's my fault, because the header
stuff is coded so poorly here, but I just wanted to mention that if you
wanted to cleanup the header code (using a proper hash table under {header}
instead of a string), you're welcome ;)
If not, well, I'll gonna have to leave with the repentance of my bad coding
habits.
Many thanks for your work on po4a,
Mt.
On Fri, Aug 06, 2004 at 10:48:53PM +0000, Jordi Vilalta wrote:
> Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
> In directory haydn:/tmp/cvs-serv314
>
> Modified Files:
> Po.pm
> Log Message:
> Added 2 new small functions: {g|s}et_charset(), that work with the po header
>
>
> Index: Po.pm
> ===================================================================
> RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
> retrieving revision 1.16
> retrieving revision 1.17
> diff -u -d -r1.16 -r1.17
> --- Po.pm 2 Aug 2004 09:35:39 -0000 1.16
> +++ Po.pm 6 Aug 2004 22:48:51 -0000 1.17
> @@ -265,7 +265,7 @@
> =item gettextize()
>
> This function produce one translated message catalog from two catalogs, an
> -original an a translation. This process is described in po4a(7), section
> +original and a translation. This process is described in po4a(7), section
> I<Gettextization: how does it work?>.
>
> =cut
> @@ -873,6 +873,39 @@
> return $msgid if ($self->{po}{$msgid}{'pos'} eq $num);
> }
> return undef;
> +}
> +
> +=item get_charset()
> +
> +This returns the character set specified in the po header. If it hasn't been
> +set, it will return "CHARSET".
> +
> +=cut
> +
> +sub get_charset() {
> + my $self=shift;
> + $self->{header} =~ /charset=(.*?)[\s\\]/;
> + return $1;
> +}
> +
> +=item set_charset()
> +
> +This sets the character set of the po header to the value specified in its
> +first argument. If you never call this function (and no file with an specified
> +character set is read), the default value is left to "CHARSET". This value
> +doesn't change the behavior of this module, it's just used to fill that field
> +in the header, and to return it in get_charset().
> +
> +=cut
> +
> +sub set_charset() {
> + my $self=shift;
> +
> + my ($newchar,$oldchar);
> + $newchar = shift;
> + $oldchar = $self->get_charset();
> +
> + $self->{header} =~ s/$oldchar/$newchar/;
> }
>
> #----[ helper functions ]---------------------------------------------------
>
>
> _______________________________________________
> Po4a-devel mailing list
> Po4a-devel(a)lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/po4a-devel
--
If you can't do it in ANSI C, it isn't worth doing.
20 years, 3 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a Po.pm,1.16,1.17
by Jordi Vilalta
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv314
Modified Files:
Po.pm
Log Message:
Added 2 new small functions: {g|s}et_charset(), that work with the po header
Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Po.pm 2 Aug 2004 09:35:39 -0000 1.16
+++ Po.pm 6 Aug 2004 22:48:51 -0000 1.17
@@ -265,7 +265,7 @@
=item gettextize()
This function produce one translated message catalog from two catalogs, an
-original an a translation. This process is described in po4a(7), section
+original and a translation. This process is described in po4a(7), section
I<Gettextization: how does it work?>.
=cut
@@ -873,6 +873,39 @@
return $msgid if ($self->{po}{$msgid}{'pos'} eq $num);
}
return undef;
+}
+
+=item get_charset()
+
+This returns the character set specified in the po header. If it hasn't been
+set, it will return "CHARSET".
+
+=cut
+
+sub get_charset() {
+ my $self=shift;
+ $self->{header} =~ /charset=(.*?)[\s\\]/;
+ return $1;
+}
+
+=item set_charset()
+
+This sets the character set of the po header to the value specified in its
+first argument. If you never call this function (and no file with an specified
+character set is read), the default value is left to "CHARSET". This value
+doesn't change the behavior of this module, it's just used to fill that field
+in the header, and to return it in get_charset().
+
+=cut
+
+sub set_charset() {
+ my $self=shift;
+
+ my ($newchar,$oldchar);
+ $newchar = shift;
+ $oldchar = $self->get_charset();
+
+ $self->{header} =~ s/$oldchar/$newchar/;
}
#----[ helper functions ]---------------------------------------------------
20 years, 3 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a TransTractor.pm,1.27,1.28
by Jordi Vilalta
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv2275
Modified Files:
TransTractor.pm
Log Message:
First small step towars the encoding support :)
Detect if the input document has non-ascii characters
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- TransTractor.pm 29 Jul 2004 01:27:51 -0000 1.27
+++ TransTractor.pm 5 Aug 2004 12:19:59 -0000 1.28
@@ -21,6 +21,8 @@
use Locale::gettext qw(dgettext);
+use Encode::Guess;
+
=head1 NAME
Po4a TransTractor - Generic trans(lator ex)tractor.
@@ -307,6 +309,8 @@
if (defined $options{'debug'}) {
$self->{TT}{debug} = $options{'debug'};
}
+ # Input document is in ascii until we prove the opposite (in read())
+ $self->{TT}{ascii_input}=1;
## initialize the plugin
$self->initialize(%options);
@@ -344,6 +348,15 @@
my $ref="$filename:$linenum";
my @entry=($textline,$ref);
push @{$self->{TT}{doc_in}}, @entry;
+
+ # 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;
+ }
+ }
}
close INPUT
or croak (sprintf(dgettext("po4a","Can't close %s after reading: %s"),$filename,$!)."\n");
20 years, 3 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a Xml.pm,1.8,1.9
by Jordi Vilalta
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv7296
Modified Files:
Xml.pm
Log Message:
Now it can work with tags' attributes :)
There are also some small cleanups, comments, and debugging messages.
Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Xml.pm 2 Aug 2004 10:29:17 -0000 1.8
+++ Xml.pm 5 Aug 2004 00:12:06 -0000 1.9
@@ -59,8 +59,6 @@
use Locale::Po4a::TransTractor;
use Locale::gettext qw(dgettext);
-#is there any better (or more standard) package than this to recode strings?
-#use Locale::Recode;
#It will mantain the path from the root tag to the current one
my @path;
@@ -109,6 +107,11 @@
=head1 OPTIONS ACCEPTED BY THIS MODULE
+The global debug option causes this module to show the excluded strings, in
+order to see if it skips something important.
+
+These are this module's particular options:
+
=over 4
=item strip
@@ -193,6 +196,8 @@
#It will mantain the list of the translateable tags
$self->{tags}=();
+ #It will mantain the list of the translateable attributes
+ $self->{attributes}=();
#It will mantain the list of the inline tags
$self->{inline}=();
@@ -258,6 +263,8 @@
if($options->{'tag_options'} =~ /W/) {
$wrap = 0;
}
+ } elsif ($options->{'type'} eq "attribute") {
+ $comment = "Attribute '".$options->{'attribute'}."' of: ".$self->get_path;
} else {
die dgettext("po4a","po4a::xml: Internal error: unknown string type.")."\n";
}
@@ -374,6 +381,7 @@
}
sub tag_extract_doctype {
+#TODO
my ($self,$remove)=(shift,shift);
my ($eof,@tag)=$self->get_string_until(']>',{include=>1,unquoted=>1});
if ($eof) {
@@ -385,6 +393,7 @@
}
sub tag_trans_doctype {
+#TODO
my ($self,@tag)=@_;
if (defined $self->{options}{'doctype'} ) {
my $doctype = $self->{options}{'doctype'};
@@ -434,7 +443,6 @@
}
sub tag_trans_close {
-#TODO
my ($self,@tag)=@_;
my $name = $self->get_tag_name(@tag);
@@ -456,20 +464,14 @@
}
sub tag_trans_alone {
-#TODO
my ($self,@tag)=@_;
my $name = $self->get_tag_name(@tag);
- my ($spaces,$attr);
push @path, $name;
-my $tag = $self->join_lines(@tag);
- $tag =~ /^(\S*)(\s*)(.*)/s;
- ($name,$spaces,$attr)=($1,$2,$3);
-
- #$attr = $self->treat_attributes(@tag); #should be only the attributes
+ $name = $self->treat_attributes(@tag);
pop @path;
- return $name.$spaces.$attr;
+ return $name;
}
sub tag_break_open {
@@ -483,17 +485,13 @@
}
sub tag_trans_open {
-#TODO
my ($self,@tag)=@_;
- my ($spaces,$attr);
my $name = $self->get_tag_name(@tag);
push @path, $name;
-my $tag = $self->join_lines(@tag);
- $tag =~ /^(\S*)(\s*)(.*)/s;
- ($name,$spaces,$attr)=($1,$2,$3);
- #$attr = $self->treat_attributes(@tag); #should be only the attributes
- return $name.$spaces.$attr;
+ $name = $self->treat_attributes(@tag);
+
+ return $name;
}
##### END of Generic XML tag types #####
@@ -700,68 +698,89 @@
return $found;
}
-
-
-
-
-
-
-
-
-#TODO
-
=head2 WORKING WITH ATTRIBUTES
=over 4
=item treat_attributes
-TODO
+This function handles the tags attributes' translation. It receives the tag
+without the beginning / end marks, and then it finds the attributes, and it
+translates the translateables (specified by the option "attributes"). This
+returns a plain string with the translated tag.
=back
=cut
sub treat_attributes {
- my ($self,@attribs)=@_;
-my $attribs = $self->join_lines(@attribs);
- if ( $attribs ne "" ) {
-#print $structure[$#structure]."\n";
-# print $attribs."\n";
- my $value=$self->attribute($attribs,"type");
-# print $value."\n";
- if ($value ne "") {
- $attribs=$self->attribute($attribs,"type","asereje");
- print $attribs."\n";
- }
- }
- return $attribs;
-}
+ my ($self,@tag)=@_;
-sub attribute {
- my ($self,@attribs,$attrib,$value)=(shift,shift,shift,shift);
-my $attribs = $self->join_lines(@attribs);
- my ($val,$quotes)=("","");
- if ( $attribs =~ /\Q$attrib\E=(\")(.*?)\" |
- \Q$attrib\E=(\')(.*?)\' |
- \Q$attrib\E=()(\S*?)/sx ) {
- if (defined($2)) {
- $quotes=$1;
- $val=$2;
- } elsif (defined($4)) {
- $quotes=$3;
- $val=$4;
- } else {
- $quotes=$5;
- $val=$6;
+ $tag[0] =~ /^(\S*)(.*)/s;
+ my $text = $1;
+ $tag[0] = $2;
+
+ while (@tag) {
+ my $complete = 1;
+
+ $text .= $self->skip_spaces(\@tag);
+ if (@tag) {
+ # Get the attribute's name
+ $complete = 0;
+
+ $tag[0] =~ /^([^\s=]+)(.*)/s;
+ my $name = $1;
+ my $ref = $tag[1];
+ $tag[0] = $2;
+ $text .= $name;
+ $text .= $self->skip_spaces(\@tag);
+ if (@tag) {
+ # Get the '='
+ if ($tag[0] =~ /^=(.*)/s) {
+ $tag[0] = $1;
+ $text .= "=";
+ $text .= $self->skip_spaces(\@tag);
+ if (@tag) {
+ # Get the value
+ my $value="";
+ $ref=$tag[1];
+ my $quot=substr($tag[0],0,1);
+ if ($quot ne "\"" and $quot ne "'") {
+ # Unquoted value
+ $quot="";
+ $tag[0] =~ /^(\S+)(.*)/s;
+ $value = $1;
+ $tag[0] = $2;
+ } else {
+ # Quoted value
+ $text .= $quot;
+ $tag[0] =~ /^\Q$quot\E(.*)/s;
+ $tag[0] = $1;
+ while ($tag[0] !~ /\Q$quot\E/) {
+ $value .= $tag[0];
+ shift @tag;
+ shift @tag;
+ }
+ $tag[0] =~ /^(.*?)\Q$quot\E(.*)/;
+ $value .= $1;
+ $tag[0] = $2;
+ }
+ $complete = 1;
+ if ($self->tag_in_list($self->get_path.$name,@{$self->{attributes}})) {
+ $text .= $self->found_string($value, $ref, { type=>"attribute", attribute=>$name });
+ } else {
+ $text .= $value;
+ print sprintf(dgettext ("po4a","po4a::xml: Contents of attribute %s excluded: %s"),$self->get_path.$name,$value)."\n"
+ if $self->debug();
+ }
+ $text .= $quot;
+ }
+ }
+ }
+ if (!$complete) { die sprintf(dgettext ("po4a","po4a::xml: Bad attribute syntax at %s"),$ref)."\n"; }
}
}
- if (!defined($value)) {
- return $val;
- } else {
- $attribs =~ s/\Q$attrib\E=$quotes\Q$val\E$quotes/\Q$attrib\E=$quotes\Q$value\E$quotes/s;
- return $attribs;
- }
+ return $text;
}
@@ -826,6 +845,7 @@
}
}
+ # Translate the string when needed
if ( length($self->join_lines(@paragraph)) > 0 ) {
my $struc = $self->get_path;
my $options = $self->tag_in_list($struc,@{$self->{tags}});
@@ -839,9 +859,8 @@
} else {
$inlist = 1;
}
-#print $self->{options}{'tagsonly'}."==".$inlist."\n";
if ( $self->{options}{'tagsonly'} eq $inlist ) {
-#print "YES\n";
+ # This tag should be translated
$self->pushline($self->found_string(
$self->join_lines(@paragraph),
$paragraph[1], {
@@ -849,12 +868,14 @@
tag_options=>$options
}));
} else {
-#print "NO\n";
-#TODO: should print that this tag isn't translated in verbose mode
+ # Inform that this tag isn't translated in debug mode
+ print sprintf(dgettext ("po4a","po4a::xml: Contents of tag %s excluded: %s"), $self->get_path,$self->join_lines(@paragraph))."\n"
+ if $self->debug();
$self->pushline($self->join_lines(@paragraph));
}
}
+ # Push the trailing blanks
if ($blank ne "") {
$self->pushline($blank);
}
@@ -883,17 +904,19 @@
my $self = shift;
$self->{options}{'tags'} =~ /\s*(.*)\s*/s;
- my @list = split(/\s+/s,$1);
- $self->{tags} = \@list;
+ my @list_tags = split(/\s+/s,$1);
+ $self->{tags} = \@list_tags;
-# $self->{options}{'attributes'}
+ $self->{options}{'attributes'} =~ /\s*(.*)\s*/s;
+ my @list_attr = split(/\s+/s,$1);
+ $self->{attributes} = \@list_attr;
$self->{options}{'inline'} =~ /\s*(.*)\s*/s;
- my @list2 = split(/\s+/s,$1);
- $self->{inline} = \@list2;
+ my @list_inline = split(/\s+/s,$1);
+ $self->{inline} = \@list_inline;
}
-=head2 GETTING TEXT FROM THE INPUT STREAM
+=head2 GETTING TEXT FROM THE INPUT DOCUMENT
=over
@@ -987,13 +1010,36 @@
return ($eof,@text);
}
+=item skip_spaces
+
+This function receives as argument the pointer to a paragraph (in the format
+returned by get_string_until) and skips his heading spaces.
+
+=cut
+
+sub skip_spaces {
+ my ($self,$pstring)=@_;
+ my $space="";
+
+ while (@$pstring and (@$pstring[0] =~ /^(\s+)(.*)$/s or @$pstring[0] eq "")) {
+ if (@$pstring[0] ne "") {
+ $space .= $1;
+ @$pstring[0] = $2;
+ }
+
+ if (@$pstring[0] eq "") {
+ shift @$pstring;
+ shift @$pstring;
+ }
+ }
+ return $space;
+}
+
=item join_lines
This function returns a simple string with the text from the argument array
(discarding the references).
-=back
-
=cut
sub join_lines {
@@ -1007,6 +1053,8 @@
return $text;
}
+=back
+
=head1 STATUS OF THIS MODULE
Well... hmm... If this works for you now, you're using a very simple
@@ -1014,16 +1062,14 @@
=head1 TODO LIST
-ATTRIBUTES
-
-MODIFY TAG TYPES FROM INHERITED MODULES
-(move the tag_types structure inside the $self hash?)
-
XML HEADER (ENCODING)
DOCTYPE (ENTITIES)
INCLUDED FILES
+
+MODIFY TAG TYPES FROM INHERITED MODULES
+(move the tag_types structure inside the $self hash?)
breaking tag inside non-breaking tag (possible?) causes ugly comments
20 years, 3 months
[Po4a-devel]Encoding options
by Jordi Vilalta
Hi,
Today I had a quick look around the charset options and I got some
questions:
I haven't seen any named option for choosing the po file charset. Should
we have one (-P, --po-charset), or should we handle all the po files with
the same charset?
po4a-translate doesn't have the option to select the localized file
charset. Should we put it? Or may it take it from the po file?
What should the defaults point to? iso-8859-1? utf-8? Something else?
I'll try to put my hands on TransTractor and try to see how to integrate
all this. Hopefully it won't hurt too much :)
Regards,
Jordi Vilalta
20 years, 3 months
Re: [Po4a-devel][CVS] po4a/lib/Locale/Po4a Po.pm,1.15,1.16
by Martin Quinson
On Mon, Aug 02, 2004 at 09:35:41AM +0000, Martin Quinson wrote:
>
> Modified Files:
> Po.pm
> Log Message:
> Implement a tool I dream of since a long time: msgsearch, which allows you
> to filter out some messages of the po file and put them in another
I needed it for the perl documentation project. We have to split per file.
So, I did it ;)
It works reasonably well and you can apply some complex filter.
'(&(reference="po4a:")(msgid= ))' gives you all the strings extracter out of
po4a and containing a space.
But:
- the flags and the comments are not reported to the file (gasp)
- some complex expressions still break the parser:
'(&(reference="po4a:")(&(flags=fuzzy)(msgid= )))'
'(|(flags=fuzzy)(!(msgstr=.)))' which should give you all the fuzzy or
untranslated messages.
Anyway. I'm too tired to hack further on po4a.
> +=item filter()
>
> This function extract a catalog from an existing one. Only the entries having a
> reference in the given file will be placed in the resulting catalog.
>
> +This function parses its argument, convert it to a perl function definition,
> +eval this definition and filter the fields for which this function returns true.
> +I love perl sometimes ;)
> +
> =cut
' night, Mt.
--
This message has been made up using recycled ideas and language constructs.
No tree has been cut nor animal harmed in process of making it.
20 years, 3 months