[Po4a-devel][CVS] po4a po4a,1.3,1.4
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv648
Modified Files:
po4a
Log Message:
Properly handle the escape of EOL; make a error message more explicit; accept declaration of document without translation
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- po4a 17 Jul 2004 10:12:21 -0000 1.3
+++ po4a 18 Jul 2004 06:02:53 -0000 1.4
@@ -215,15 +215,16 @@
$nb++;
s/#.*//;
$line.=$_;
+ chomp($line);
next if ($line =~ s/\\$//);
next unless ($line =~ /\S/);
$line =~ s/ +/ /g;
$line =~ s/^ //;
$line =~ s/ $//;
- die sprintf("%s:%d: ".gettext("Syntax error.")."\n",$config_file,$nb)
- unless ($line =~ m/^\[([^\]]*)\] (\S+) (.*)?$/);
- my ($cmd,$main,$args)=($1,$2,$3);
+ die sprintf("%s:%d: ".gettext("Syntax error: %s")."\n",$config_file,$nb,$line)
+ unless ($line =~ m/^\[([^\]]*)\] (\S+) (.*)$/ || $line =~ m/^\[([^\]]*)\] (\S+)$/);
+ my ($cmd,$main,$args)=($1,$2,$3||"");
print "cmd=[$cmd]; main=$main; args=\"$args\"\n" if $debug;
20 years, 4 months
[Po4a-devel][CVS] po4a/po/bin po4a.pot,1.19,1.20
by Martin Quinson
Update of /cvsroot/po4a/po4a/po/bin
In directory haydn:/tmp/cvs-serv12186
Modified Files:
po4a.pot
Log Message:
Sync to the code (again ; sorry)
Index: po4a.pot
===================================================================
RCS file: /cvsroot/po4a/po4a/po/bin/po4a.pot,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- po4a.pot 16 Jul 2004 23:19:59 -0000 1.19
+++ po4a.pot 18 Jul 2004 05:30:05 -0000 1.20
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-07-16 15:41-0700\n"
+"POT-Creation-Date: 2004-07-17 22:24-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -16,8 +16,8 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../../po4a-normalize:102 ../../po4a-gettextize:147 ../../po4a:165
-#: ../../po4a-updatepo:128 ../../po4a-translate:163
+#: ../../po4a-normalize:102 ../../po4a-gettextize:149 ../../po4a:165
+#: ../../po4a-updatepo:130 ../../po4a-translate:165
#, perl-format
msgid ""
"%s version %s.\n"
@@ -29,8 +29,8 @@
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
msgstr ""
-#: ../../po4a-normalize:144 ../../po4a-gettextize:194
-#: ../../po4a-gettextize:196 ../../po4a:206 ../../po4a-updatepo:178
+#: ../../po4a-normalize:144 ../../po4a-gettextize:196
+#: ../../po4a-gettextize:198 ../../po4a:206 ../../po4a-updatepo:180
#, perl-format
msgid "File %s does not exist."
msgstr ""
@@ -70,22 +70,22 @@
msgid "po4a_paths not declared. Dunno where to find the pot and po files"
msgstr ""
-#: ../../po4a:276 ../../po4a:299 ../../po4a-updatepo:203
+#: ../../po4a:276 ../../po4a:299 ../../po4a-updatepo:205
#, perl-format
msgid "Updating %s:"
msgstr ""
-#: ../../po4a:279 ../../po4a:306 ../../po4a-updatepo:210
+#: ../../po4a:279 ../../po4a:306 ../../po4a-updatepo:212
#, perl-format
msgid "Creating %s:"
msgstr ""
-#: ../../po4a:302 ../../po4a-updatepo:206
+#: ../../po4a:302 ../../po4a-updatepo:208
#, perl-format
msgid "Error while running msgmerge: %s"
msgstr ""
-#: ../../po4a:309 ../../po4a-updatepo:213
+#: ../../po4a:309 ../../po4a-updatepo:215
#, perl-format
msgid "Error while copying the po file: %s"
msgstr ""
@@ -100,39 +100,39 @@
msgid "Addendum %s does apply to %s (translation discarded)."
msgstr ""
-#: ../../po4a-updatepo:179
+#: ../../po4a-updatepo:181
msgid "po4a-update can't take the input po from the file '-'."
msgstr ""
-#: ../../po4a-updatepo:188
+#: ../../po4a-updatepo:190
#, perl-format
msgid "Can't create a temporary pot file: %s"
msgstr ""
-#: ../../po4a-updatepo:191
+#: ../../po4a-updatepo:193
msgid "Parse input files... "
msgstr ""
-#: ../../po4a-updatepo:198
+#: ../../po4a-updatepo:200
msgid "done."
msgstr ""
-#: ../../po4a-translate:203 ../../po4a-translate:204
+#: ../../po4a-translate:205 ../../po4a-translate:206
#, perl-format
msgid "%s: file %s does not exist."
msgstr ""
-#: ../../po4a-translate:232
+#: ../../po4a-translate:234
#, perl-format
msgid "%s is %s%% translated (%s of %s strings)"
msgstr ""
-#: ../../po4a-translate:238
+#: ../../po4a-translate:240
#, perl-format
msgid "Discard the translation of %s (only %s%% translated; need %s%%)."
msgstr ""
-#: ../../po4a-translate:245
+#: ../../po4a-translate:247
#, perl-format
msgid "Discard the translation of %s (addendum %s does not apply)."
msgstr ""
@@ -386,8 +386,8 @@
#: ../../lib/Locale/Po4a/Man.pm:667
#, perl-format
msgid ""
-"po4a::man: Unknown macro '%s'. Remove it from the document,\n"
-"po4a::man: or provide a patch to <po4a-devel(a)lists.alioth.debian.org>."
+"po4a::man: Unknown macro '%s' (at %s).\n"
+"po4a::man: Remove it from the document, or provide a patch to the po4a team."
msgstr ""
#: ../../lib/Locale/Po4a/Man.pm:888
20 years, 4 months
[Po4a-devel][CVS] po4a/po/bin fr.po,1.20,1.21
by Martin Quinson
Update of /cvsroot/po4a/po4a/po/bin
In directory haydn:/tmp/cvs-serv12096
Modified Files:
fr.po
Log Message:
Sync to EN
Index: fr.po
===================================================================
RCS file: /cvsroot/po4a/po4a/po/bin/fr.po,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- fr.po 16 Jul 2004 23:27:26 -0000 1.20
+++ fr.po 18 Jul 2004 05:29:43 -0000 1.21
@@ -7,16 +7,16 @@
msgstr ""
"Project-Id-Version: po4a 0.16\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-07-16 15:41-0700\n"
-"PO-Revision-Date: 2004-07-16 16:27-0700\n"
+"POT-Creation-Date: 2004-07-17 22:24-0700\n"
+"PO-Revision-Date: 2004-07-17 22:29-0700\n"
"Last-Translator: Martin Quinson <Martin.Quinson(a)tuxfamily.org>\n"
"Language-Team: french <debian-l10n-french(a)lists.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../../po4a-normalize:102 ../../po4a-gettextize:147 ../../po4a:165
-#: ../../po4a-updatepo:128 ../../po4a-translate:163
+#: ../../po4a-normalize:102 ../../po4a-gettextize:149 ../../po4a:165
+#: ../../po4a-updatepo:130 ../../po4a-translate:165
#, perl-format
msgid ""
"%s version %s.\n"
@@ -36,8 +36,8 @@
"donnée; tant pour des raisons COMMERCIALES que pour\n"
"RÉPONDRE À UN BESOIN PARTICULIER."
-#: ../../po4a-normalize:144 ../../po4a-gettextize:194
-#: ../../po4a-gettextize:196 ../../po4a:206 ../../po4a-updatepo:178
+#: ../../po4a-normalize:144 ../../po4a-gettextize:196
+#: ../../po4a-gettextize:198 ../../po4a:206 ../../po4a-updatepo:180
#, perl-format
msgid "File %s does not exist."
msgstr "Le fichier %s n'existe pas."
@@ -79,22 +79,22 @@
msgstr ""
"po4a_paths n'est pas déclaré. Localisation des fichiers pot et po inconnue."
-#: ../../po4a:276 ../../po4a:299 ../../po4a-updatepo:203
+#: ../../po4a:276 ../../po4a:299 ../../po4a-updatepo:205
#, perl-format
msgid "Updating %s:"
msgstr "Mise à jour de %s :"
-#: ../../po4a:279 ../../po4a:306 ../../po4a-updatepo:210
+#: ../../po4a:279 ../../po4a:306 ../../po4a-updatepo:212
#, perl-format
msgid "Creating %s:"
msgstr "Création de %s :"
-#: ../../po4a:302 ../../po4a-updatepo:206
+#: ../../po4a:302 ../../po4a-updatepo:208
#, perl-format
msgid "Error while running msgmerge: %s"
msgstr "Erreur lors de l'exécution de msgmerge : %s"
-#: ../../po4a:309 ../../po4a-updatepo:213
+#: ../../po4a:309 ../../po4a-updatepo:215
#, perl-format
msgid "Error while copying the po file: %s"
msgstr "Erreur lors de la copie du fichier po : %s"
@@ -109,42 +109,45 @@
msgid "Addendum %s does apply to %s (translation discarded)."
msgstr "L'addendum %s ne s'applique pas à %s (la traduction est ignorée)."
-#: ../../po4a-updatepo:179
+#: ../../po4a-updatepo:181
msgid "po4a-update can't take the input po from the file '-'."
msgstr "po4a-update ne peut utiliser le fichier '-' comme fichier po."
-#: ../../po4a-updatepo:188
+#: ../../po4a-updatepo:190
#, perl-format
msgid "Can't create a temporary pot file: %s"
msgstr "Impossible de créer le fichier pot temporaire : %s"
-#: ../../po4a-updatepo:191
+#: ../../po4a-updatepo:193
msgid "Parse input files... "
msgstr "Analyse des fichiers d'entrée... "
-#: ../../po4a-updatepo:198
+#: ../../po4a-updatepo:200
msgid "done."
msgstr "fait."
-#: ../../po4a-translate:203 ../../po4a-translate:204
+#: ../../po4a-translate:205 ../../po4a-translate:206
#, perl-format
msgid "%s: file %s does not exist."
msgstr "%s: le fichier %s n'existe pas."
-#: ../../po4a-translate:232
+#: ../../po4a-translate:234
#, perl-format
msgid "%s is %s%% translated (%s of %s strings)"
msgstr "%s est traduit à %s%% (%s chaînes sur %s)"
-#: ../../po4a-translate:238
+#: ../../po4a-translate:240
#, perl-format
msgid "Discard the translation of %s (only %s%% translated; need %s%%)."
-msgstr "La traduction de %s n'a pas été retenue (seulement %s%% sont traduits, %s%% sont nécessaires)."
+msgstr ""
+"La traduction de %s n'a pas été retenue (seulement %s%% sont traduits, %s%% "
+"sont nécessaires)."
-#: ../../po4a-translate:245
+#: ../../po4a-translate:247
#, perl-format
msgid "Discard the translation of %s (addendum %s does not apply)."
-msgstr "La traduction de %s n'a pas été retenue (l'addendum %s ne s'applique pas)."
+msgstr ""
+"La traduction de %s n'a pas été retenue (l'addendum %s ne s'applique pas)."
#: ../../lib/Locale/Po4a/KernelHelp.pm:106
#, perl-format
@@ -452,11 +455,11 @@
#: ../../lib/Locale/Po4a/Man.pm:667
#, perl-format
msgid ""
-"po4a::man: Unknown macro '%s'. Remove it from the document,\n"
-"po4a::man: or provide a patch to <po4a-devel(a)lists.alioth.debian.org>."
+"po4a::man: Unknown macro '%s' (at %s).\n"
+"po4a::man: Remove it from the document, or provide a patch to the po4a team."
msgstr ""
-"po4a::man: Macro '%s' inconnue. Retirez-la du document, ou fournissez\n"
-"po4a::man: un correctif à <po4a-devel(a)lists.alioth.debian.org>."
+"po4a::man: Macro '%s' inconnue (en %s).\n"
+"po4a::man: Retirez-la du document, ou fournissez un correctif à l'équipe de po4a."
#: ../../lib/Locale/Po4a/Man.pm:888
msgid ""
20 years, 4 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a Man.pm,1.15,1.16
by Martin Quinson
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv11484
Modified Files:
Man.pm
Log Message:
Make an error message more useful
Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Man.pm 30 Apr 2004 22:47:58 -0000 1.15
+++ Man.pm 18 Jul 2004 05:25:49 -0000 1.16
@@ -664,9 +664,9 @@
} else {
$self->pushline($line."\n");
die sprintf(gettext(
- "po4a::man: Unknown macro '%s'. Remove it from the document,\n".
- "po4a::man: or provide a patch to <po4a-devel\(a)lists.alioth.debian.org>."
- ),$line)."\n";
+ "po4a::man: Unknown macro '%s' (at %s).\n".
+ "po4a::man: Remove it from the document, or provide a patch to the po4a team."
+ ),$line,$ref)."\n";
}
} elsif ($line =~ /^( +)([^.].*)/) {
20 years, 4 months
[Po4a-devel][CVS] po4a po4a-gettextize,1.20,1.21 po4a-normalize,1.15,1.16 po4a-translate,1.22,1.23 po4a-updatepo,1.20,1.21
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv3055
Modified Files:
po4a-gettextize po4a-normalize po4a-translate po4a-updatepo
Log Message:
Shorten, clarify and unify the command synopsis
Index: po4a-normalize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-normalize,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- po4a-normalize 25 May 2004 19:19:32 -0000 1.15
+++ po4a-normalize 18 Jul 2004 05:13:24 -0000 1.16
@@ -18,7 +18,7 @@
=head1 SYNOPSIS
-po4a-normalize -f E<lt>formatE<gt> E<lt>original.docE<gt>
+po4a-normalize -f E<lt>fmtE<gt> E<lt>master.docE<gt>
=head1 DESCRIPTION
Index: po4a-translate
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-translate,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- po4a-translate 16 Jul 2004 23:14:12 -0000 1.22
+++ po4a-translate 18 Jul 2004 05:13:24 -0000 1.23
@@ -18,7 +18,9 @@
=head1 SYNOPSIS
-po4a-translate -f E<lt>formatE<gt> [E<lt>other optionsE<gt>] -m E<lt>master.docE<gt> -p E<lt>translation.poE<gt>
+po4a-translate -f E<lt>fmtE<gt> -m E<lt>master.docE<gt> -p E<lt>XX.poE<gt> -l E<lt>XX.docE<gt>
+
+(XX.doc is the output, all others are input)
=head1 DESCRIPTION
Index: po4a-updatepo
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-updatepo,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- po4a-updatepo 25 May 2004 19:19:32 -0000 1.20
+++ po4a-updatepo 18 Jul 2004 05:13:24 -0000 1.21
@@ -18,7 +18,9 @@
=head1 SYNOPSIS
-po4a-updatepo -f E<lt>formatE<gt> (--master|-m E<lt>master.docE<gt>)+ (--po|-p E<lt>translation.poE<gt>)+
+po4a-updatepo -f E<lt>fmtE<gt> (-m E<lt>master.docE<gt>)+ (-p E<lt>XX.poE<gt>)+
+
+(XX.po are the output, all others are input)
=head1 DESCRIPTION
Index: po4a-gettextize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-gettextize,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- po4a-gettextize 25 May 2004 19:19:32 -0000 1.20
+++ po4a-gettextize 18 Jul 2004 05:13:24 -0000 1.21
@@ -18,7 +18,9 @@
=head1 SYNOPSIS
-po4a-gettextize -f E<lt>formatE<gt> -m E<lt>master.docE<gt> [-l E<lt>localized.docE<gt>] -p E<lt>translation.poE<gt>
+po4a-gettextize -f E<lt>fmtE<gt> -m E<lt>master.docE<gt> [-l E<lt>XX.docE<gt>] -p E<lt>XX.poE<gt>
+
+(XX.po is the output, all others are input)
=head1 DESCRIPTION
20 years, 4 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a Xml.pm,NONE,1.1
by Jordi Vilalta
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv23545
Added Files:
Xml.pm
Log Message:
Initial commit of Xml.pm
--- NEW FILE: Xml.pm ---
#!/usr/bin/perl
# Po4a::Xml.pm
#
# extract and translate translatable strings from XML documents.
#
# This code extracts plain text from tags and attributes from generic
# XML documents, and it can be used as a base to build modules for
# XML-based documents.
#
# Copyright (c) 2004 by Jordi Vilalta <jvprat(a)wanadoo.es>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
########################################################################
=head1 NAME
Locale::Po4a::Xml - Convert XML documents and derivates from/to PO files
=head1 DESCRIPTION
The goal po4a [po for anything] project is to ease translations (and more
interestingly, the maintenance of translation) using gettext tools on areas
where they were not expected like documentation.
Locale::Po4a::Xml is a module to help the translation of XML documents into
other [human] languages. It can also be used as a base to build modules for
XML-based documents.
=cut
package Locale::Po4a::Xml;
use 5.006;
use strict;
use warnings;
require Exporter;
use vars qw(@ISA @EXPORT);
@ISA = qw(Locale::Po4a::TransTractor);
@EXPORT = qw(new initialize);
use Locale::Po4a::TransTractor;
use Locale::gettext qw(gettext);
#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 @structure;
sub read {
my ($self,$filename)=@_;
push @{$self->{DOCPOD}{infile}}, $filename;
$self->Locale::Po4a::TransTractor::read($filename);
}
sub parse {
my $self=shift;
map {$self->parse_file($_)} @{$self->{DOCPOD}{infile}};
}
=head1 TRANSLATING WITH PO4A::XML
This module can be used directly to handle generic XML documents. This will
extract all tag's contents, and no attributes, since it's where the text is
written in most XML based documents.
There are some options (described in the next section) that can customize
this behavior. If this doesn't fit to your document format you're encouraged
to write your own module derived from this, to describe your format's details.
See the section "Writing derivate modules" below, for the process description.
=cut
#
# Parse file and translate it
#
sub parse_file {
my ($self,$filename) = @_;
my $eof = 0;
while (!$eof) {
# We get all the text until the next breaking tag (not
# inline) and translate it
$eof = $self->treat_content;
if (!$eof) {
# And then we treat the following breaking tag
$eof = $self->treat_tag;
}
}
}
=head1 OPTIONS ACCEPTED BY THIS MODULE
=over 4
=item strip
Makes it strip the spaces around the extracted strings. (Typical)
=item wrap
Canonizes the string to translate, considering that whitespaces are not
important, and wraps the translated document.
=item caseinsensitive (TODO)
It makes the tags and attributes searching to work in a case insensitive
way. If it's defined, it will treat <BooK>laNG and <BOOK>Lang as <book>lang.
=item tagsonly
Extracts only the specified tags in the "translate" option. Otherwise, it
will extract all the tags except the ones specified.
=item doctype
String that will try to match with the first line of the document's doctype
(if defined). If it doesn't, the document will be considered of a bad type.
=item tags
Space-separated list of the tags you want to translate or skip. By default,
the specified tags will be excluded, but if you use the "tagsonly" option,
the specified tags will be the only ones included. The tags must be in the
form <aaa>, but you can join some (<bbb><aaa>) to say that the contents of
the tag <aaa> will only be translated when it's into a <bbb> tag.
=item attributes (TODO)
Space-separated list of the tag's attributes you want to translate. You can
specify the attributes by their name (for example, "lang"), but you can
prefix it with a tag hierarchy, to specify that this tag will only be
translated when it's into the specified tag. For example: <bbb><aaa>lang
specifies that the lang attribute will only be translated if it's into an
<aaa> tag, and it's into a <bbb> tag.
=item inline
Space-separated list of the tags you want to treat as inline. By default,
all tags break the sequence. This follows the same syntax as the tags option.
=cut
sub initialize {
my $self = shift;
my %options = @_;
$self->{options}{'strip'}=0;
$self->{options}{'wrap'}=0;
$self->{options}{'caseinsensitive'}=0;
$self->{options}{'tagsonly'}=0;
$self->{options}{'tags'}='';
$self->{options}{'attributes'}='';
$self->{options}{'inline'}='';
$self->{options}{'doctype'}='';
$self->{options}{'verbose'}='';
$self->{options}{'debug'}='';
foreach my $opt (keys %options) {
if ($options{$opt}) {
die sprintf(gettext ("po4a::xml: Unknown option: %s"), $opt)."\n" unless exists $self->{options}{$opt};
$self->{options}{$opt} = $options{$opt};
}
}
#It will mantain the list of the translateable tags
$self->{tags}=();
#It will mantain the list of the inline tags
$self->{inline}=();
$self->treat_options;
}
=head1 WRITING DERIVATE MODULES
=head2 DEFINE WHAT TAGS AND ATTRIBUTES TO TRANSLATE
The simplest customization is to define which tags and attributes you want
the parser to translate. This should be done in the initialize function.
First you should call the main initialize, to get the command-line options,
and then, append your custom definitions to the options hash. If you want
to treat some new options from command line, you should define them before
calling the main initialize:
$self->{options}{'new_option'}='';
$self->SUPER::initialize(%options);
$self->{options}{'tags'}.=' <p> <head><title>';
$self->{options}{'attributes'}.=' <p>lang id';
$self->{options}{'inline'}.=' <br>';
$self->treat_options;
=head2 OVERRIDING THE found_string FUNCTION
Another simple step is to override the function "found_string", which
receives the extracted strings from the parser, in order to translate them.
There you can control which strings you want to translate, and perform
transformations to them before or after the translation itself.
It receives the extracted text, the reference on where it was, and a
comment that tells if it's an attribute value, a tag content... It must
return the text that will replace the original in the translated document.
Here's a basic example of this function:
sub found_string {
my ($self,$text,$ref,$comment)=@_;
$text = $self->translate($text,$ref,$comment,
'wrap'=>$self->{options}{'wrap'});
return $text;
}
There's another simple example in the new Dia module, which only filters
some strings.
=cut
sub found_string {
my ($self,$text,$ref,$comment)=@_;
$text = $self->translate($text,$ref,$comment,
'wrap'=>$self->{options}{'wrap'});
return $text;
}
=head2 MODIFYING TAG TYPES (TODO)
This is a more complex one, but it enables a (almost) total customization.
It's based in a list of hashes, each one defining a tag type's behavior. The
list should be sorted so that the most general tags are after the most
concrete ones (sorted first by the beginning and then by the end keys). To
define a tag type you'll have to make a hash with the following keys:
=over 4
=item beginning
Specifies the beginning of the tag, after the "<".
=item end
Specifies the end of the tag, before the ">".
=item breaking
It says if this is a breaking tag class. A non-breaking (inline) tag is one
that can be taken as part of the content of another tag. It can take the
values false (0), true (1) or undefined. If you leave this undefined, you'll
have to define the f_breaking function that will say whether a concrete tag of
this class is a breaking tag or not.
=item f_breaking
It's a function that will tell if the next tag is a breaking one or not. It
should be defined if the "breaking" option is not.
=item f_extract
If you leave this key undefined, the extraction function will have to extract
the tag itself. It's useful for tags that can have other tags or special
structures in them, so that the main parser doesn't get mad. This function
receives a boolean that says if the tag should be removed from the input
stream or not.
=item f_translate
This function returns the translated tag (translated attributes or all needed
transformations) as a single string.
=cut
##### Generic XML tag types #####
my @tag_types = (
{ beginning => "!--",
end => "--",
breaking => 1,
f_extract => \&tag_extract_comment,
f_translate => \&tag_trans_comment},
{ beginning => "?xml",
end => "?",
breaking => 1,
f_translate => \&tag_trans_xmlhead},
# { beginning => "?",
# end => "?",
# breaking => 1,
# f_translate => \&tag_trans_...},
{ beginning => "!DOCTYPE",
end => "]",
breaking => 1,
f_extract => \&tag_extract_doctype,
f_translate => \&tag_trans_doctype},
{ beginning => "/",
end => "",
f_breaking => \&tag_break_close,
f_translate => \&tag_trans_close},
{ beginning => "",
end => "/",
f_breaking => \&tag_break_alone,
f_translate => \&tag_trans_alone},
{ beginning => "",
end => "",
f_breaking => \&tag_break_open,
f_translate => \&tag_trans_open}
);
sub tag_extract_comment {
my ($self,$remove)=(shift,shift);
my ($eof,@tag)=$self->get_string_until('-->',1,$remove);
return ($eof,@tag);
}
sub tag_trans_comment {
my ($self,@tag)=@_;
return $self->join_lines(@tag);
}
sub tag_trans_xmlhead {
#TODO
my ($self,@tag)=@_;
my $tag = $self->join_lines(@tag);
$tag =~ /^(\S*)(\s*)(.*)/s;
my ($name,$spaces,$attr)=($1,$2,$3);
#We get the file encoding
#my $enc=$self->attribute($attr,"encoding");
#print $enc."\n";
return $tag;
}
sub tag_extract_doctype {
my ($self,$remove)=(shift,shift);
my ($eof,@tag)=$self->get_string_until(']>',1,$remove);
return ($eof,@tag);
}
sub tag_trans_doctype {
my ($self,@tag)=@_;
if (defined $self->{options}{'doctype'} ) {
my $doctype = $self->{options}{'doctype'};
if ( $tag[0] !~ /\Q$doctype\E/i ) {
die sprintf(gettext("po4a::xml: Bad document type. '%s' expected."),$doctype)."\n";
}
}
my $i = 0;
while ( $i < $#tag ) {
if ( $tag[$i] =~ /^(<!ENTITY\s+)(.*)$/is ) {
my $part1 = $1;
my $part2 = $2;
my $includenow = 0;
my $file = 0;
my $name = "";
if ($part2 =~ /^(%\s+)(.*)$/s ) {
$part1.= $1;
$part2 = $2;
$includenow = 1;
}
$part2 =~ /^(\S+)(\s+)(.*)$/s;
$name = $1;
$part1.= $1.$2;
$part2 = $3;
if ( $part2 =~ /^(SYSTEM\s+)(.*)$/is ) {
$part1.= $1;
$part2 = $2;
$file = 1;
}
# print $part1."\n";
# print $name."\n";
# print $part2."\n";
}
$i++;
}
return $self->join_lines(@tag);
}
sub tag_break_close {
my ($self,@tag)=@_;
if ($self->tag_in_list($self->get_structure."<".
$self->get_tag_name(@tag).">",@{$self->{inline}})) {
return 0;
} else {
return 1;
}
}
sub tag_trans_close {
#TODO
my ($self,@tag)=@_;
my $name = $self->get_tag_name(@tag);
my $test = pop @structure;
if ( $test ne $name ) {
die gettext("po4a::xml: Unexpected closing tag. The main document may be wrong.")."\n";
}
return $self->join_lines(@tag);
}
sub tag_break_alone {
my ($self,@tag)=@_;
if ($self->tag_in_list($self->get_structure."<".
$self->get_tag_name(@tag).">",@{$self->{inline}})) {
return 0;
} else {
return 1;
}
}
sub tag_trans_alone {
#TODO
my ($self,@tag)=@_;
my $name = $self->get_tag_name(@tag);
my ($spaces,$attr);
push @structure, $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
pop @structure;
return $name.$spaces.$attr;
}
sub tag_break_open {
my ($self,@tag)=@_;
if ($self->tag_in_list($self->get_structure."<".
$self->get_tag_name(@tag).">",@{$self->{inline}})) {
return 0;
} else {
return 1;
}
}
sub tag_trans_open {
#TODO
my ($self,@tag)=@_;
my ($spaces,$attr);
my $name = $self->get_tag_name(@tag);
push @structure, $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;
}
##### END of Generic XML tag types #####
=head1 INTERNAL FUNCTIONS used to write derivated parsers
=head2 WORKING WITH TAGS
=item get_structure
This function returns the path to the current tag from the document's root,
in the form <html><body><p>.
=cut
sub get_structure {
my $self = shift;
if ( @structure > 0 ) {
return "<".join("><",@structure).">";
} else {
return "outside any tag (error?)";
}
}
=item tag_type
This function returns the index from the tag_types list that fits to the next
tag in the input stream, or -1 if it's at the end of the input file.
=cut
sub tag_type {
my $self = shift;
my ($line,$ref) = $self->shiftline();
my ($match1,$match2);
my $found = 0;
my $i = 0;
if (!defined($line)) { return -1; }
$self->unshiftline($line,$ref);
while (!$found && $i < @tag_types) {
($match1,$match2) = ($tag_types[$i]->{beginning},$tag_types[$i]->{end});
if ($line =~ /^<\Q$match1\E/) {
if (!defined($tag_types[$i]->{f_extract})) {
my ($eof,@lines) = $self->get_string_until(">",1,0);
my $line2 = $self->join_lines(@lines);
#print substr($line2,length($line2)-1-length($match2),1+length($match2))."\n";
if (defined($line2) and $line2 =~ /\Q$match2\E>$/) {
$found = 1;
#print "YES: <".$match1." ".$match2.">\n";
} else {
#print "NO: <".$match1." ".$match2.">\n";
$i++;
}
} else {
$found = 1;
}
} else {
$i++;
}
}
if (!$found) {
#It should never enter here, unless you undefine the most
#general tags (as <...>)
print "po4a::xml: Unknown tag type: ".$line."\n";
exit;
} else {
return $i;
}
}
=item extract_tag
This function returns the next tag from the input stream without the beginning
and end, in an array form, to mantain the references from the input file. It
has two parameters: the type of the tag (as returned by tag_type) and a
boolean, that says if it should be removed from the input stream.
=cut
sub extract_tag {
my ($self,$type,$remove) = (shift,shift,shift);
my ($match1,$match2) = ($tag_types[$type]->{beginning},$tag_types[$type]->{end});
my ($eof,@tag);
if (defined($tag_types[$type]->{f_extract})) {
($eof,@tag) = &{$tag_types[$type]->{f_extract}}($self,$remove);
} else {
($eof,@tag) = $self->get_string_until($match2.">",1,$remove);
}
$tag[0] =~ /^<\Q$match1\E(.*)$/s;
$tag[0] = $1;
$tag[$#tag-1] =~ /^(.*)\Q$match2\E>$/s;
$tag[$#tag-1] = $1;
return ($eof,@tag);
}
=item get_tag_name
This function returns the name of the tag passed as an argument, in the array
form returned by extract_tag.
=cut
sub get_tag_name {
my ($self,@tag)=@_;
$tag[0] =~ /^(\S*)/;
return $1;
}
=item breaking_tag
This function returns a boolean that says if the next tag in the input stream
is a breaking tag or not (inline tag). It leaves the input stream intact.
=cut
sub breaking_tag {
my $self = shift;
my $break;
my $type = $self->tag_type;
if ($type == -1) { return 0; }
#print "TAG TYPE = ".$type."\n";
$break = $tag_types[$type]->{breaking};
if (!defined($break)) {
# This tag's breaking depends on its content
my ($eof,@lines) = $self->extract_tag($type,0);
$break = &{$tag_types[$type]->{f_breaking}}($self,@lines);
}
#print "break = ".$break."\n";
return $break;
}
=item treat_tag
This function translates the next tag from the input stream. Using each
tag type's custom translation functions.
=cut
sub treat_tag {
my $self = shift;
my $type = $self->tag_type;
my ($match1,$match2) = ($tag_types[$type]->{beginning},$tag_types[$type]->{end});
my ($eof,@lines) = $self->extract_tag($type,1);
$lines[0] =~ /^(\s*)(.*)$/s;
my $space1 = $1;
$lines[0] = $2;
$lines[$#lines-1] =~ /^(.*?)(\s*)$/s;
my $space2 = $2;
$lines[$#lines-1] = $1;
# Calling this tag type's specific handling (translation of
# attributes...)
my $line = &{$tag_types[$type]->{f_translate}}($self,@lines);
$self->pushline("<".$match1.$space1.$line.$space2.$match2.">");
return $eof;
}
=item tag_in_list
This function returns a boolean value that says if the first argument (a tag
hierarchy) matches any of the tags from the second argument (a list of tags
or tag hierarchies).
=cut
sub tag_in_list {
my ($self,$tag,@list) = @_;
my $found = 0;
my $i = 0;
while (!$found && $i < @list) {
my $element = $list[$i];
if ( $tag =~ /\Q$element\E$/ ) {
#print $tag."==".$element."\n";
$found = 1;
}
$i++;
}
return $found;
}
#TODO
=head2 WORKING WITH ATTRIBUTES
=item treat_attributes
TODO
=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;
}
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;
}
}
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;
}
}
sub treat_content {
my $self = shift;
my $blank="";
my ($eof,@paragraph)=$self->get_string_until('<',0,1);
while (!$eof and !$self->breaking_tag) {
my @text;
# Append the found inline tag
($eof,@text)=$self->get_string_until('>',1,1);
push @paragraph, @text;
($eof,@text)=$self->get_string_until('<',0,1);
if ($#text > 0) {
push @paragraph, @text;
}
}
# This strips the extracted strings
# (only if you specify the 'strip' option)
if ($self->{options}{'strip'}) {
my $clean = 0;
# Clean the beginning
while (!$clean and $#paragraph > 0) {
$paragraph[0] =~ /^(\s*)(.*)/s;
my $match = $1;
if ($paragraph[0] eq $match) {
if ($match ne "") {
$self->pushline($match);
}
shift @paragraph;
shift @paragraph;
} else {
$paragraph[0] = $2;
if ($match ne "") {
$self->pushline($match);
}
$clean = 1;
}
}
$clean = 0;
# Clean the end
while (!$clean and $#paragraph > 0) {
$paragraph[$#paragraph-1] =~ /^(.*?)(\s*)$/s;
my $match = $2;
if ($paragraph[$#paragraph-1] eq $match) {
if ($match ne "") {
$blank = $match.$blank;
}
pop @paragraph;
pop @paragraph;
} else {
$paragraph[$#paragraph-1] = $1;
if ($match ne "") {
$blank = $match.$blank;
}
$clean = 1;
}
}
}
if ( length($self->join_lines(@paragraph)) > 0 ) {
my $struc = $self->get_structure;
my $inlist = $self->tag_in_list($struc,@{$self->{tags}});
#print $self->{options}{'tagsonly'}."==".$inlist."\n";
if ( $self->{options}{'tagsonly'} eq $inlist ) {
#print "YES\n";
$self->pushline($self->found_string($self->join_lines(@paragraph),
$paragraph[1],"Content of tag ".$struc));
} else {
#print "NO\n";
$self->pushline($self->join_lines(@paragraph));
}
}
if ($blank ne "") {
$self->pushline($blank);
}
return $eof;
}
=head2 WORKING WITH THE MODULE OPTIONS
=item treat_options
This function fills the internal structures that contain the tags, attributes
and inline data with the options of the module (specified in the command-line
or in the initialize function).
=cut
sub treat_options {
my $self = shift;
$self->{options}{'tags'} =~ /\s*(.*)\s*/s;
my @list = split(/\s+/s,$1);
$self->{tags} = \@list;
# $self->{options}{'attributes'}
$self->{options}{'inline'} =~ /\s*(.*)\s*/s;
my @list2 = split(/\s+/s,$1);
$self->{inline} = \@list2;
}
=head2 GETTING TEXT FROM THE INPUT STREAM
=item get_string_until
This function returns an array with the lines (and references) from the input
stream until it finds the first argument. The second argument is a boolean
that says if the returned array should contain the searched text or not. The
third argument is another boolean that says if the returned stream should be
removed from the input or not.
=cut
sub get_string_until {
# search = the text we want to find (at the moment it can't have \n's)
# include = include the searched text in the returned paragraph
# remove = remove the returned text from input or leave it intact
my ($self,$search,$include,$remove) = (shift,shift,shift,shift);
if (!defined($include)) { $include = 0; }
if (!defined($remove)) { $remove = 0; }
my ($line,$ref) = $self->shiftline();
my (@text,$paragraph);
my ($eof,$found) = (0,0);
while (defined($line) and !$found) {
push @text, ($line,$ref);
$paragraph .= $line;
if ( $paragraph =~ /.*\Q$search\E.*/s ) {
$found = 1;
} else {
($line,$ref)=$self->shiftline();
}
}
if (!defined($line)) { $eof = 1; }
if ( $found ) {
if(!$include) {
$text[$#text-1] =~ /(.*?)(\Q$search\E.*)/s;
$text[$#text-1] = $1;
$line = $2;
} else {
$text[$#text-1] =~ /(.*?\Q$search\E)(.*)/s;
$text[$#text-1] = $1;
$line = $2;
}
if (defined($line) and ($line ne "")) {
$self->unshiftline ($line,$text[$#text]);
}
}
if (!$remove) {
my $i = $#text;
while ($i > 0) {
$self->unshiftline ($text[$i-1],$text[$i]);
$i -= 2;
}
}
#If we get to the end of the file, we return the whole paragraph
return ($eof,@text);
}
=item join_lines
This function returns a simple string with the text from the argument array
(discarding the references).
=cut
sub join_lines {
my ($self,@lines)=@_;
my ($line,$ref);
my $text = "";
while ($#lines > 0) {
($line,$ref) = (shift @lines,shift @lines);
$text .= $line;
}
return $text;
}
=head1 STATUS OF THIS MODULE
Well... hmm... If this works for you now, you're using a very simple
document format ;)
=head1 SEE ALSO
L<po4a(7)>, L<Locale::Po4a::TransTranctor(3pm)>.
=head1 AUTHORS
Jordi Vilalta <jvprat(a)wanadoo.es>
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2004 by Jordi Vilalta <jvprat(a)wanadoo.es>
This program is free software; you may redistribute it and/or modify it
under the terms of GPL (see COPYING file).
=cut
1;
##### TODO LIST #####
#
#OPTIONS
#caseinsensitive
#attributes
#
#MODIFY TAG TYPES FROM INHERITED MODULES
#(move the tag_types structure inside the $self hash?)
#
#DOCTYPE (ENTITIES)
#INCLUDED FILES
#
#XML HEADER (ENCODING)
#
#breaking tag inside non-breaking tag (possible?) causes ugly comments
20 years, 4 months
[Po4a-devel][CVS] po4a po4a,1.2,1.3
by Jordi Vilalta
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv29601
Modified Files:
po4a
Log Message:
Fixed a typo
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- po4a 16 Jul 2004 23:13:06 -0000 1.2
+++ po4a 17 Jul 2004 10:12:21 -0000 1.3
@@ -61,7 +61,7 @@
<lang>:<path to the po file for this lang>
-=head2 Specifying the documents to translates
+=head2 Specifying the documents to translate
You now naturally have to to specify which documents are translated, their
format, and where to put the translations. It can be made by such lines:
20 years, 4 months
[Po4a-devel][CVS] po4a Build.PL,1.4,1.5
by Jordi Vilalta
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv7142
Modified Files:
Build.PL
Log Message:
Get the binary catalogs generation outside the po updating (usually po files
will be uptodate, but we want to generate the .mo files)
Index: Build.PL
===================================================================
RCS file: /cvsroot/po4a/po4a/Build.PL,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Build.PL 16 Jul 2004 23:11:54 -0000 1.4
+++ Build.PL 17 Jul 2004 07:36:00 -0000 1.5
@@ -71,13 +71,13 @@
} else {
rename "po/bin/$lang.po.new", "po/bin/$lang.po" || die;
}
- unless ($self->up_to_date("po/bin/$lang.po","blib/po/$lang/LC_MESSAGES/po4a.mo")) {
- system("mkdir -p blib/po/$lang/LC_MESSAGES") && die;
- system("msgfmt -o blib/po/$lang/LC_MESSAGES/po4a.mo po/bin/$lang.po") && die;
- }
} else {
print "XX po/bin/$lang.po uptodate.\n";
}
+ unless ($self->up_to_date("po/bin/$lang.po","blib/po/$lang/LC_MESSAGES/po4a.mo")) {
+ system("mkdir -p blib/po/$lang/LC_MESSAGES") && die;
+ system("msgfmt -o blib/po/$lang/LC_MESSAGES/po4a.mo po/bin/$lang.po") && die;
+ }
}
}
20 years, 4 months
[Po4a-devel][CVS] po4a README,1.8,1.9
by Jordi Vilalta
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv7093
Modified Files:
README
Log Message:
Forget Makefile.PL
Index: README
===================================================================
RCS file: /cvsroot/po4a/po4a/README,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- README 26 May 2004 17:39:50 -0000 1.8
+++ README 17 Jul 2004 07:33:23 -0000 1.9
@@ -15,9 +15,7 @@
To install this module type the following:
- perl Makefile.PL
make
- make test
make install
20 years, 4 months
[Po4a-devel][CVS] po4a/po/bin ca.po,1.3,1.4 es.po,1.5,1.6
by Jordi Vilalta
Update of /cvsroot/po4a/po4a/po/bin
In directory haydn:/tmp/cvs-serv32218
Modified Files:
ca.po es.po
Log Message:
Sync /po/bin/ca.po and /po/bin/es.po to en
Index: ca.po
===================================================================
RCS file: /cvsroot/po4a/po4a/po/bin/ca.po,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ca.po 16 Jul 2004 23:19:59 -0000 1.3
+++ ca.po 17 Jul 2004 07:16:44 -0000 1.4
@@ -8,7 +8,7 @@
"Project-Id-Version: po4a bin\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-07-16 15:41-0700\n"
-"PO-Revision-Date: 2004-07-16 09:37+0100\n"
+"PO-Revision-Date: 2004-07-17 09:05+0100\n"
"Last-Translator: Jordi Vilalta <jvprat(a)wanadoo.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -134,14 +134,16 @@
msgstr "%s està traduït en un %s%% (%s de %s cadenes)"
#: ../../po4a-translate:238
-#, fuzzy, perl-format
+#, perl-format
msgid "Discard the translation of %s (only %s%% translated; need %s%%)."
-msgstr "S'ha descartat la traducció de %s: tan sols hi ha un %s%% traduït."
+msgstr ""
+"S'ha descartat la traducció de %s (tan sols hi ha un %s%% traduït; es "
+"necessita un %s%%)."
#: ../../po4a-translate:245
#, perl-format
msgid "Discard the translation of %s (addendum %s does not apply)."
-msgstr ""
+msgstr "S'ha descartat la traducció de %s (no s'ha pogut aplicar l'annex %s)."
#: ../../lib/Locale/Po4a/KernelHelp.pm:106
#, perl-format
@@ -649,34 +651,3 @@
#, perl-format
msgid "%s:%d: Unknown SGML event type: %s"
msgstr "%s:%d: Tipus d'event SGML desconegut: %s"
-
-#~ msgid ""
-#~ "ERROR: translation of %s discarded: only %s%% are translated ; %s%% is "
-#~ "needed to keep translations."
-#~ msgstr ""
-#~ "ERROR: s'ha descartat la traducció de %s: tan sols hi ha un %s%% "
-#~ "traduït ; es necessita un %s%% per mantenir les traduccions."
-
-#~ msgid ""
-#~ "ERROR: file %s couldn't be added to %s.\n"
-#~ " This translation is therefore discarded."
-#~ msgstr ""
-#~ "ERROR: l'arxiu %s no s'ha pogut afegir a %s.\n"
-#~ " Com a conseqüència, s'ha descartat aquesta traducció."
-
-#~ msgid ""
-#~ "%s verson %s.\n"
-#~ "written by Martin Quinson and Denis Barbier.\n"
-#~ "\n"
-#~ "Copyright (C) 2002, 2003, 2004 Software of 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."
-#~ msgstr ""
-#~ "%s versió %s.\n"
-#~ "escrit per Martin Quinson i Denis Barbier.\n"
-#~ "\n"
-#~ "Copyright (C) 2002, 2003, 2004 Software of Public Interest, Inc.\n"
-#~ "Això és software lliure; mireu el codi font per les condicions\n"
-#~ "de còpia. No es dóna CAP garantia; ni tan sols per finalitats\n"
-#~ "COMERCIALS o ADAPTACIO A UN PROPOSIT PARTICULAR."
Index: es.po
===================================================================
RCS file: /cvsroot/po4a/po4a/po/bin/es.po,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- es.po 16 Jul 2004 23:19:59 -0000 1.5
+++ es.po 17 Jul 2004 07:16:44 -0000 1.6
@@ -8,7 +8,7 @@
"Project-Id-Version: po4a bin\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-07-16 15:41-0700\n"
-"PO-Revision-Date: 2004-07-16 09:42+0100\n"
+"PO-Revision-Date: 2004-07-17 09:07+0100\n"
"Last-Translator: Jordi Vilalta <jvprat(a)wanadoo.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -135,14 +135,18 @@
msgstr "%s está traducido en un %s%% (%s de %s cadenas)"
#: ../../po4a-translate:238
-#, fuzzy, perl-format
+#, perl-format
msgid "Discard the translation of %s (only %s%% translated; need %s%%)."
-msgstr "Se ha descartado la traducción de %s: sólo se ha traducido un %s%%."
+msgstr ""
+"Se ha descartado la traducción de %s (sólo se ha traducido un %s%%; se "
+"necesita un %s%%)."
#: ../../po4a-translate:245
#, perl-format
msgid "Discard the translation of %s (addendum %s does not apply)."
msgstr ""
+"Se ha descartado la traducción de %s (no se ha podido aplicar el apéndice %"
+"s)."
#: ../../lib/Locale/Po4a/KernelHelp.pm:106
#, perl-format
@@ -650,17 +654,3 @@
#, perl-format
msgid "%s:%d: Unknown SGML event type: %s"
msgstr "%s:%d: Tipo de evento SGML desconocido: %s"
-
-#~ msgid ""
-#~ "ERROR: translation of %s discarded: only %s%% are translated ; %s%% is "
-#~ "needed to keep translations."
-#~ msgstr ""
-#~ "ERROR: se ha descartado la traducción de %s: sólo se ha traducido un %s%"
-#~ "%; se necesita un %s%% para mantener las traducciones."
-
-#~ msgid ""
-#~ "ERROR: file %s couldn't be added to %s.\n"
-#~ " This translation is therefore discarded."
-#~ msgstr ""
-#~ "ERROR: el archivo %s no se ha podido añadir a %s.\n"
-#~ " Por consiguiente, se ha desechado ésta traducción."
20 years, 4 months