[Po4a-devel][CVS] po4a/debian control,1.8,1.9
by Martin Quinson
Update of /cvsroot/po4a/po4a/debian
In directory haydn:/tmp/cvs-serv6088/debian
Modified Files:
control
Log Message:
Shorten the description of KernelHelp; speak about Dia; add a dependency on libintl-perl (Locale::Recode) for Dia
Index: control
===================================================================
RCS file: /cvsroot/po4a/po4a/debian/control,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- control 24 Mar 2004 21:57:20 -0000 1.8
+++ control 25 May 2004 17:48:43 -0000 1.9
@@ -8,7 +8,7 @@
Package: po4a
Architecture: all
-Depends: perl | perl5, gettext (>= 0.11), liblocale-gettext-perl, perl-modules, libsgmls-perl, sp
+Depends: perl | perl5, gettext (>= 0.11), liblocale-gettext-perl, perl-modules, libsgmls-perl, sp, libintl-perl
Conflicts: po-pod, po-man, liblocale-po4a-perl
Description: Tools for helping translation of documentation
The po4a (po for anything) project goal is to ease translations (and
@@ -18,8 +18,8 @@
This package contains the main libraries of po4a, and the following
sub-modules:
.
- - KernelHelp: The help messages associated with each kernel compilation
- option.
+ - KernelHelp: Help messages of each kernel compilation option.
- Man: Good old manual page format.
- Pod: Perl documentation format.
- Sgml: either debiandoc or docbook DTD.
+ - Dia: uncompressed Dia diagrams.
20 years, 6 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a Chooser.pm,1.10,1.11
by Martin Quinson
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv6074/lib/Locale/Po4a
Modified Files:
Chooser.pm
Log Message:
Shorten the description of KernelHelp
Index: Chooser.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Chooser.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Chooser.pm 25 May 2004 16:51:22 -0000 1.10
+++ Chooser.pm 25 May 2004 17:48:03 -0000 1.11
@@ -45,7 +45,7 @@
sub list {
warn gettext("List of valid formats:\n".
- " - kernelhelp: The help messages associated with each kernel compilation option.\n".
+ " - kernelhelp: Help messages of each kernel compilation option.\n".
# " - html: HTML documents (EXPERIMENTAL).\n".
" - man: Good old manual page format.\n".
" - pod: Perl Online Documentation format.\n".
20 years, 6 months
[Po4a-devel][CVS] po4a/t 01-classes.t,1.1,1.2
by Martin Quinson
Update of /cvsroot/po4a/po4a/t
In directory haydn:/tmp/cvs-serv4741/t
Modified Files:
01-classes.t
Log Message:
Put the 'use module' in eval block, so that we can test each of them separately; Add the dia module
Index: 01-classes.t
===================================================================
RCS file: /cvsroot/po4a/po4a/t/01-classes.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- 01-classes.t 6 Nov 2003 16:35:58 -0000 1.1
+++ 01-classes.t 25 May 2004 17:37:13 -0000 1.2
@@ -2,15 +2,24 @@
#########################
-use Test::Simple tests =>7;
+use Test::More tests =>8;
-use Locale::Po4a::Po; ok(1, 'Po.pm loadable');
-use Locale::Po4a::TransTractor; ok(1, 'TransTractor.pm loadable');
+eval qq{use Locale::Po4a::Po}; ok(!$@, 'Po.pm loadable');
+diag($@) if $@;
+eval qq{use Locale::Po4a::TransTractor}; ok(!$@, 'TransTractor.pm loadable');
+diag($@) if $@;
-use Locale::Po4a::KernelHelp; ok(1, 'KernelHelp.pm loadable');
-use Locale::Po4a::Man; ok(1, 'Man.pm loadable');
-use Locale::Po4a::Pod; ok(1, 'Pod.pm loadable');
-use Locale::Po4a::Sgml; ok(1, 'Sgml.pm loadable');
+eval qq{use Locale::Po4a::KernelHelp}; ok(!$@, 'KernelHelp.pm loadable');
+diag($@) if $@;
+eval qq{use Locale::Po4a::Man}; ok(!$@, 'Man.pm loadable');
+diag($@) if $@;
+eval qq{use Locale::Po4a::Pod}; ok(!$@, 'Pod.pm loadable');
+diag($@) if $@;
+eval qq{use Locale::Po4a::Sgml}; ok(!$@, 'Sgml.pm loadable');
+diag($@) if $@;
-use Locale::Po4a::Chooser; ok(1, 'Chooser.pm loadable');
+eval qq{use Locale::Po4a::Dia}; ok(!$@, 'Dia.pm loadable');
+diag($@) if $@;
+eval qq{use Locale::Po4a::Chooser}; ok(!$@, 'Chooser.pm loadable');
+diag($@) if $@;
20 years, 6 months
[Po4a-devel][CVS] po4a/lib/Locale/Po4a Dia.pm,NONE,1.1
by Martin Quinson
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv4654/lib/Locale/Po4a
Added Files:
Dia.pm
Log Message:
Dia module from Jordi
--- NEW FILE: Dia.pm ---
#!/usr/bin/perl
# Po4a::Dia.pm
#
# extract and translate translatable strings from Dia diagrams.
#
# This code extracts plain text from string tags on uncompressed Dia
# diagrams.
#
# 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::Dia - Convert uncompressed Dia diagrams 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::Dia is a module to help the translation of diagrams in the
uncompressed Dia format into other [human] languages.
You can get Dia (the graphical editor for these diagrams) from:
http://www.gnome.org/projects/dia/
=head1 TRANSLATING WITH PO4A::DIA
This module only translates uncompressed Dia diagrams. You can save your
uncompressed diagrams with Dia itself, unchecking the "Compress diagram
files" at the "Save Diagram" dialog.
Another way is to uncompress the dia files from command line with:
gunzip < original.dia > uncompressed.dia
=head1 STATUS OF THIS MODULE
It Works For Me (tm). Currently it only searches for translateable strings,
without parsing the xml code around. It's quite simple, but it works, and
gives a perfect output for valid input files. It only translates the content
of the E<lt>dia:stringE<gt> tags, but it seems to be all the text present at the
diagrams.
It skips the content of the E<lt>dia:diagramdataE<gt> tag because there are usually
some strings that are for internal use of Dia (not interesting for translation).
Currently it tries to get the diagram encoding from the first line (the xml
declaration), and else it assumes UTF-8, and creates the .po contens in the
ISO-8859-1 character set. It would be nice if it could read the command line
encoding options, but I haven't watched how to do it.
It uses Locale::Recode from the package libintl to recode the character
sets. You can get it from http://search.cpan.org/~guido/libintl-perl-1.10/
There may be a better or more standard module to do this, but I didn't know.
You're welcome to improve it.
This module should work, and it shouldn't break anything, but it needs more
testing.
=head1 SEE ALSO
L<po4a(7)>, L<Locale::Po4a::TransTranctor(3pm)>, L<Locale::Po4a::Pod(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
package Locale::Po4a::Dia;
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;
sub initialize {}
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}};
}
#
# Parse file and translate it
#
sub parse_file {
my ($self,$filename)=@_;
my ($line,$ref);
my ($paragraph,$reference); #The text to be translated
#Initializing the recoding objects
# d2p: dia to po
# p2d: po to dia
my ($d2p,$p2d,$charset_dia,$charset_po);
($line,$ref)=$self->shiftline();
if (defined($line)) {
#Try to get the document encoding from the xml header
if ( $line =~ /<\?xml.*?encoding="(.*)".*\?>/ ) {
$charset_dia = $1;
} else {
#Dia's default is UTF-8
$charset_dia = 'UTF-8';
warn gettext("po4a::dia: Couldn't find file encoding. Assuming UTF-8.")."\n";
}
#how to get command line options to override it?
$charset_po = 'ISO-8859-1';
$d2p = Locale::Recode->new(from => $charset_dia,
to => $charset_po);
die $d2p->getError if $d2p->getError;
$p2d = Locale::Recode->new(from => $charset_po,
to => $charset_dia);
die $p2d->getError if $p2d->getError;
}
while (defined($line)) {
#don't translate any string between <dia:diagramdata> tags
if ( $line =~ /^<dia:diagramdata>(.*)/s ) {
$line = $1;
$self->pushline("<dia:diagramdata>");
while ( $line !~ /<\/dia:diagramdata>/ ) {
$self->pushline($line);
($line,$ref)=$self->shiftline();
}
$line =~ /(.*?<\/dia:diagramdata>)(.*)/s;
$self->pushline($1);
$line = $2;
} else {
if ( $line =~ /(.*?)(<dia:diagramdata>.*)/s ) {
$self->unshiftline($2,$ref);
$line = $1;
}
}
#if current line has an opening <dia:string> tag, we get
#all the paragraph to translate (posibly from next lines)
if ( $line =~ /(.*?)<dia:string>#(.*)/s ) {
#pushing the text before the tag as is
$self->pushline($1);
#save the beginning of the tag contens and its position
$paragraph = $2;
$reference = $ref;
#append the following lines to the paragraph until we
#find the closing tag
while ( $paragraph !~ /.*#<\/dia:string>/ ) {
($line,$ref)=$self->shiftline();
$paragraph .= $line;
}
$paragraph =~ /(.*?)#<\/dia:string>(.*)/s;
$paragraph = $1;
#put the text after the closing tag back to the input
#(there could be more than one string to translate on
#the same line)
$self->unshiftline($2,$ref);
#recode the paragraph to the po character set
$d2p->recode($paragraph);
$paragraph = $self->translate($paragraph,$reference,"<dia:string>");
#recode the translation to the dia character set
$p2d->recode($paragraph);
#inserts translation to output
$self->pushline("<dia:string>#".$paragraph."#</dia:string>");
} else {
#doesn't have text to translate: push line as is
$self->pushline($line);
}
#get next line
($line,$ref)=$self->shiftline();
}
}
20 years, 6 months
[Po4a-devel][CVS] po4a/t 21-dia.t,NONE,1.1
by Martin Quinson
Update of /cvsroot/po4a/po4a/t
In directory haydn:/tmp/cvs-serv4654/t
Added Files:
21-dia.t
Log Message:
Dia module from Jordi
--- NEW FILE: 21-dia.t ---
#! /usr/bin/perl
# DIA module tester.
#########################
use strict;
use warnings;
my @tests;
mkdir "t/tmp" unless -e "t/tmp";
my $diff_po_flags = " -I '^# SOME' -I '^# Test' ".
"-I '^\"POT-Creation-Date: ' -I '^\"Content-Type:' -I '^\"Content-Transfer-Encoding:'";
$tests[0]{'run'} = '../po4a-gettextize -f dia -m data-21/extract.dia -p tmp/dia_extract.po';
$tests[0]{'test'} = "diff -u $diff_po_flags data-21/extract.po-ok tmp/dia_extract.po";
$tests[0]{'doc'} = 'get only needed strings';
$tests[1]{'run'} = '../po4a-translate -f dia -m data-21/transl.dia -p data-21/transl.po -l tmp/transl.dia';
$tests[1]{'test'} = 'diff -u data-21/transl.dia-ok tmp/transl.dia';
$tests[1]{'doc'} = 'test translations with new-lines';
use Test::More tests =>4; # tests * (run+validity)
for (my $i=0; $i<scalar @tests; $i++) {
chdir "t" || die "Can't chdir to my test directory";
my ($val,$name);
my $cmd=$tests[$i]{'run'};
$val=system($cmd);
$name=$tests[$i]{'doc'}.' runs';
ok($val == 0,$name);
diag(%{$tests[$i]{'run'}}) unless ($val == 0);
SKIP: {
skip ("Command don't run, can't test the validity of its return",1)
if $val;
$val=system($tests[$i]{'test'});
$name=$tests[$i]{'doc'}.' returns what is expected';
ok($val == 0,$name);
unless ($val == 0) {
diag ("Failed (retval=$val) on:");
diag ($tests[$i]{'test'});
diag ("Was created with:");
diag ($tests[$i]{'run'});
}
}
# system("rm -f tmp/* 2>&1");
chdir ".." || die "Can't chdir back to my root";
}
0;
20 years, 6 months
[Po4a-devel][CVS] po4a/debian changelog,1.43,1.44
by Martin Quinson
Update of /cvsroot/po4a/po4a/debian
In directory haydn:/tmp/cvs-serv4548
Modified Files:
changelog
Log Message:
Document last changes+cosmetics
Index: changelog
===================================================================
RCS file: /cvsroot/po4a/po4a/debian/changelog,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- changelog 1 May 2004 20:42:29 -0000 1.43
+++ changelog 25 May 2004 17:33:50 -0000 1.44
@@ -20,6 +20,8 @@
only tags. The translation of those is always the msgid itself.
Thanks Jordi for falling into that trap ;)
- Detect msgid containing one entity and spaces, and skip them also.
+ - Add a 'include-all' option preventing the optimization described on
+ two previous items.
- Permit the translation of entity definition (not for file including
ones, but for the rewrite ones). Thanks Jordi for the hint.
- Add missing tags (articleinfo, which was savannah's #8475, and some more)
@@ -36,10 +38,13 @@
Denis Barbier
* Call 'xgettext -L Perl' instead of '-L c' to extract messages from
- Perl scripts. Remove trailing newlines from gettext messages.
+ Perl scripts.
+ * Remove trailing newlines from gettext messages.
Jordi Vilalta
* [po/bin/es.po] Add Spanish translation
+ * [Dia.pm] New module for the diagrams saved by dia program
+ * [t/21-dia.t t/data-21] Relevant tests
--
20 years, 6 months
[Po4a-devel][CVS] po4a MANIFEST,1.4,1.5
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv2675
Modified Files:
MANIFEST
Log Message:
Add the Dia module from Jordi
Index: MANIFEST
===================================================================
RCS file: /cvsroot/po4a/po4a/MANIFEST,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- MANIFEST 28 Apr 2004 08:42:37 -0000 1.4
+++ MANIFEST 25 May 2004 17:25:16 -0000 1.5
@@ -18,6 +18,7 @@
lib/Locale/Po4a/Po.pm
lib/Locale/Po4a/Pod.pm
lib/Locale/Po4a/Sgml.pm
+lib/Locale/Po4a/Dia.pm
lib/Locale/Po4a/TransTractor.pm
po/Makefile
po/bin/Makefile
@@ -74,3 +75,10 @@
t/20-xml.t
t/data-20/text.xml
t/data-20/xml.po
+
+t/21-dia.t
+t/data-21/extract.dia
+t/data-21/extract.po-ok
+t/data-21/transl.dia
+t/data-21/transl.dia-ok
+t/data-21/transl.po
20 years, 6 months
[Po4a-devel][CVS] po4a README,1.4,1.5
by Martin Quinson
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv2586
Modified Files:
README
Log Message:
Explain how to use the CVS version without installation
Index: README
===================================================================
RCS file: /cvsroot/po4a/po4a/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- README 30 Apr 2004 21:45:02 -0000 1.4
+++ README 25 May 2004 17:24:42 -0000 1.5
@@ -21,6 +21,13 @@
make install
+USE WITHOUT INSTALLATION
+
+If you want to use a version without installing it (such as the CVS one),
+use the PERLLIB environment variable is such construction:
+
+ PERLLIB=~/CVSIMPORT/po4a/lib ~/CVSIMPORT/po4a/po4a-gettextize [usual args]
+
PO4A DEPENDENCIES
Locale::gettext (v1.01):
20 years, 6 months
[Po4a-devel][CVS] po4a/t/data-21 extract.dia,NONE,1.1 extract.po-ok,NONE,1.1 transl.dia-ok,NONE,1.1 transl.dia,NONE,1.1 transl.po,NONE,1.1
by Martin Quinson
Update of /cvsroot/po4a/po4a/t/data-21
In directory haydn:/tmp/cvs-serv28122/t/data-21
Added Files:
extract.dia extract.po-ok transl.dia-ok transl.dia transl.po
Log Message:
Some tests about Dia [Jordi]
--- NEW FILE: extract.dia ---
<?xml version="1.0" encoding="UTF-8"?><dia:string>#Test
string 1#</dia:string><dia:diagramdata><dia:string>#Test string 2#</dia:string><dia:string>#Test
string 3#</dia:string><dia:string>#Test string 4#</dia:string></dia:diagramdata><dia:string>#Test string 5#</dia:string><dia:string>#Test string 6#</dia:string><dia:diagramdata><dia:string>#Test string 7#</dia:string></dia:diagramdata><dia:string>#Test string 8#</dia:string>
--- NEW FILE: extract.po-ok ---
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-05-22 12:39+0200\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING"
# type: <dia:string>
#: data-04/extract.dia:2
#, no-wrap
msgid ""
"Test\n"
"string 1"
msgstr ""
# type: <dia:string>
#: data-04/extract.dia:4
#, no-wrap
msgid "Test string 5"
msgstr ""
# type: <dia:string>
#: data-04/extract.dia:4
#, no-wrap
msgid "Test string 6"
msgstr ""
# type: <dia:string>
#: data-04/extract.dia:4
#, no-wrap
msgid "Test string 8"
msgstr ""
--- NEW FILE: transl.dia-ok ---
<?xml version="1.0" encoding="UTF-8"?><dia:string>#Translated first string#</dia:string><dia:diagramdata><dia:string>#String not translateable#</dia:string></dia:diagramdata><dia:string>#Translated string in one line#</dia:string>
<dia:string>#Translated string
in two lines#</dia:string>
<dia:string>#Translated string
in three
lines#</dia:string>
--- NEW FILE: transl.po ---
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-05-22 12:49+0200\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING"
# type: <dia:string>
#: transl.dia:2
#, no-wrap
msgid "First test string"
msgstr "Translated first string"
# type: <dia:string>
#: transl.dia:2
#, no-wrap
msgid ""
"Test string in\n"
"two lines"
msgstr "Translated string in one line"
# type: <dia:string>
#: transl.dia:4
#, no-wrap
msgid ""
"Test string\n"
"in three\n"
"lines"
msgstr ""
"Translated string\n"
"in two lines"
# type: <dia:string>
#: transl.dia:7
#, no-wrap
msgid "Last test string"
msgstr ""
"Translated string\n"
"in three\n"
"lines"
--- NEW FILE: transl.dia ---
<?xml version="1.0" encoding="UTF-8"?><dia:string>#First test string#</dia:string><dia:diagramdata><dia:string>#String not translateable#</dia:string></dia:diagramdata><dia:string>#Test string in
two lines#</dia:string>
<dia:string>#Test string
in three
lines#</dia:string>
<dia:string>#Last test string#</dia:string>
20 years, 6 months