[Po4a-devel]Common.pm: Remove obsolete load_config export
by Francois Gouget
I noticed that Common.pm exports 'load_config' but I could find no place
where this symbol is defined or used. So I assume this is an obsolete
export which can be removed. I removed it and po4a still seems to be
working so here is the patch.
Changelog:
* lib/Locale/Po4a/Common.pm
Francois Gouget <fgouget(a)codeweavers.com>
Remove obsolete load_config export.
--
Francois Gouget
fgouget(a)codeweavers.com
Index: lib/Locale/Po4a/Common.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Common.pm,v
retrieving revision 1.8
diff -u -p -r1.8 Common.pm
--- lib/Locale/Po4a/Common.pm 30 May 2005 07:00:34 -0000 1.8
+++ lib/Locale/Po4a/Common.pm 30 May 2005 14:58:50 -0000
@@ -24,7 +24,7 @@ package Locale::Po4a::Common;
require Exporter;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
-@EXPORT = qw(wrap_msg wrap_mod wrap_ref_mod textdomain gettext dgettext load_config);
+@EXPORT = qw(wrap_msg wrap_mod wrap_ref_mod textdomain gettext dgettext);
use 5.006;
use strict;
19 years, 3 months
[Po4a-devel]Winedocs and Po4a dependencies
by Francois Gouget
For the Wine project we are trying to make it as easy as possible for
Wine contributors to modify and rebuild the Wine documentation. The Po4a
dependencies have caused some concern in this regard: for each
dependency the contributor will have to track down which package to
install for his distribution and this makes the initial setup
significantly harder.
Po4a being not very widespread we have checked it in the Winedocs CVS
(http://cvs.sourceforge.net/viewcvs.py/wine/docs/). But Po4a has quite a
few dependencies so this does not help very much. So now we are hoping
to make it possible to reduce the number of po4a dependencies. Here is
the list I came up with, together with some notes for each of them:
* Locale::gettext (perl module)
Needed by po4a for localization.
Provided by liblocale-gettext-perl on Debian, perl-Locale-gettext on
Mandrake and Fedora Core(DAG), perl-gettext on SUSE.
Would you be open to a patch that acted as a wrapper around
Locale::gettext so that po4a would continue to work untranslated if that
module was missing?
The idea we would add a 'Po4aGettext' module that would export
gettext() and dgettext() functions. These would try to load
Locale::gettext in an eval function and use it if that succeeds.
Otherwise the Po4aGettext would simply return the untranslated strings.
The only changes to the other Po4a modules would be replacing 'use
Locale::gettext' with 'use Po4aGettext'.
* Text::WrapI18N (perl module)
Pure perl (so easy to check in) but depends on Text::CharWidth which
is not pure perl.
Provided by libtext-wrapi18n-perl on Debian. Found no RPM packages
providing it.
Text::WrapI18N was not used in po4a 0.16.2. I initially thought it
was used to wrap the text being output to the .po and .sgml files but in
fact it seems to only be used to print messages, warnings and errors.
Why is it needed? Doesn't a simple print work fine?
* Term::ReadKey (perl module)
Provided by libterm-readkey-perl on Debian, perl-Term-ReadKey on
Mandrake and Fedora Core(DAG), perl-TermReadKey on SUSE.
This module is used to determine the size of the terminal. This
information is then used by the wrap functions.
* SGMLS (perl module)
Needed by po4a to interface with the nsgmls parser.
Pure perl (so easy to check in).
Provided by libsgmls-perl on Debian, perl-SGMLSpm on Mandrake and
Fedora Core, perl-SGMLS on SUSE.
This is an essential part of po4a. The easiest way to remove this
dependency would be to check it into the Winedocs repository. So no
action needed on the Po4a side.
* nsgmls (command line tool)
Needed by po4a to parse the Sgml files.
Provided by sp on Debian, sgml-tools or openjade on Mandrake and
Fedora Core, opensp on SUSE.
This is an essential part of po4a. So it will have to remain as a
dependency which is reasonable.
--
Francois Gouget
fgouget(a)codeweavers.com
19 years, 4 months
[Po4a-devel]Sgml and generic file inclusion
by Nicolas François
Hello,
With Martin having no time, but spending a lot of time on po4a, it seems
the right moment to ask this.
First, extracting the file inclusion part from the TeX module to put it in
the Transtractor works.
It has mostly one drawback: the file inclusion has to be done in one line.
For example:
.so foo.1
or:
\include{foo.tex}\input{bar}
should work, but:
<!ENTITY foo SYSTEM
foo_foo_foo_foo_foo_foo_foo_foo_foo_foo_foo_foo_foo_foo.sgml>
will not work (at least currently; if it is needed, it will work)
To use this file inclusion mechanism, a module will have to implement one
function, which will find the filename and return the piece of text to put
before and after the inclusion of the given file. (it is a littel bit more
complicated, but basically works this way).
For example, the Man module could return "", "foo.1", "" when it receive
".so foo.1"
Other facilities are also provided (for example, the TeX module needs find
a file wether the .tex extension is given or not).
So here are some questions regarding the Sgml module:
Is there any problem with the current implementation of the inclusion?
The Sgml module is quite different from the other modules (the lines are
not shifted one by one, but the file is given in its whole to nsgmls. So
is this module a good choice for testing the file inclusion? Maybe I can
try to implement it in order to be able to use the whole file.
Is there another module which could need inclusion, and could be used to
test if this mechanism is sufficient and generic enough
I will submit the patch to the list, so you can have a look at it. But I'm
a little bit reluctant at committing it before it is tested by at least
two modules.
Kind Regards,
--
Nekral
19 years, 4 months
[Po4a-devel]$BFCJL4k2h!*0lK|1_J,;H$$J|Bj(B?
by info@kqsv14.com
$BK\F|!"?75,EPO?$N$*5RMM$K8B$j0lK|1_J,;H$$J|Bj$N%3!<%9$r@_$1$^$7$?(B
http://www.awg4.com/?chance14
$B"-"-"d$*CN$i$;"c"-"-(B
$B"((B($B2hA|(B)$B!!(B($BF02h(B)$B!!(B($BD>EE(B)$B!!(B($BD>%a(B)$B$r<+M3$K8r49=PMh$^$9(B
$B"($"$k$*5RMM$O(BFREE$B$G$N%A%c%C%H$b8D!9$G3Z$7$s$G$$$k8+$?$$$G$9$M!*(B
$B!J0lBP0lKt$OJ#?t$NJ}$H$N%A%c%C%H!K(B
$B"(CK=wHfN("M(B4$B!'(B6$B$H=w@-2q0w$,B??t2q0w$H$J$C$F$*$j$^$9!#(B
$B"-@'Hs!"GA$$$F$M!*"-(B
http://www.awg4.com/?chance14
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
$B<u?.5qH]$O(Bawg_kanri2004(a)ok.kz
18$B:PL$K~6X;_(B
19 years, 4 months
[Po4a-devel]Sgml.pm: Issue an error if nsgmls is missing
by Francois Gouget
When the nsgmls parser is missing po4a-translate just reports success
and that the documentation is translated to 100% when in fact it does
nothing. This could be pretty confusing. Reporting that nsgmls is
missing would be better.
So I propose this patch to detect that nsgmls is missing and issue an
error. The trick here is we run it on an empty Sgml document and check
that it returned success which should ensure that it works, etc. The
'document' in question uses DocBook and that may be an issue if all the
user wants to use if DebianDoc or some other Sgml document type. Also
the check is performed in initialize() and this may not be the best place.
Alternate solutions would be to:
* we could look for nsgmls in $PATH manually and issue an error if we
could not find it.
* we could check nsgmls' return code after the close(IN) in parse().
What makes this tricky is the way we invoke nsgmls but I think it would
be feasible anyway.
So let me know which approach seems best.
Changelog:
* lib/Locale/Po4a/Sgml.pm
Francois Gouget <fgouget(a)codeweavers.com>
Check for nsgmls and issue an error if it is missing.
--
Francois Gouget
fgouget(a)codeweavers.com
Index: lib/Locale/Po4a/Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.55
diff -u -p -r1.55 Sgml.pm
--- lib/Locale/Po4a/Sgml.pm 21 May 2005 18:42:21 -0000 1.55
+++ lib/Locale/Po4a/Sgml.pm 25 May 2005 01:04:39 -0000
@@ -195,7 +195,15 @@ my $xmlprolog = undef; # the '<?xml ...
sub initialize {
my $self = shift;
my %options = @_;
-
+
+ # Check that nsgmls is installed
+ my $cmd="echo '<!doctype article PUBLIC \"-//OASIS//DTD DocBook V3.1//EN\"><article><para></para></article>' | nsgmls 2>&1";
+ my $output=`$cmd`;
+ if ($? != 0)
+ {
+ die "po4a::sgml: nsgmls is missing or non-functional:\n$output";
+ }
+
$self->{options}{'translate'}='';
$self->{options}{'section'}='';
$self->{options}{'indent'}='';
19 years, 4 months
[Po4a-devel]Make the Locale::gettext dependency optional
by Francois Gouget
Here is a patch to make the Locale::gettext dependency optional. What it
does is implement wrapper functions in Po4a::Common as was discussed in
the previous email.
The gettext() and dgettext() functions call their Locale::gettext
counterpart in an eval and return the string untranslated if that fails.
The textdomain() wrapper works similarly but also make the setlocale()
call which also removes the dependency on POSIX.
Many files are modified by this patch but in fact for most of them the
only change is removing the 'use Locale::gettext' statement. The two
exceptions are Po4a::Common (of course) and Po4a::Po which defines its
own gettext() function and thus must not import the Po4a::Common one
(just like it did not import the Locale::gettext one before).
Changelog:
* msgsearch
po4a
po4a-gettextize
po4a-normalize
po4a-translate
po4a-updatepo
lib/Locale/Po4a/Chooser.pm
lib/Locale/Po4a/Common.pm
lib/Locale/Po4a/Debconf.pm
lib/Locale/Po4a/Html.pm
lib/Locale/Po4a/Man.pm
lib/Locale/Po4a/NewsDebian.pm
lib/Locale/Po4a/Po.pm
lib/Locale/Po4a/Sgml.pm
lib/Locale/Po4a/TeX.pm
lib/Locale/Po4a/TransTractor.pm
lib/Locale/Po4a/Xml.pm
Francois Gouget <fgouget(a)codeweavers.com>
Implement wrappers for textdomain(), gettext() and dgettext() in
Po4a::Common to make the dependency on Locale::gettext optional.
--
Francois Gouget
fgouget(a)codeweavers.com
Index: msgsearch
===================================================================
RCS file: /cvsroot/po4a/po4a/msgsearch,v
retrieving revision 1.6
diff -u -p -r1.6 msgsearch
--- msgsearch 27 Feb 2005 22:56:00 -0000 1.6
+++ msgsearch 28 May 2005 18:12:03 -0000
@@ -143,13 +142,10 @@ use warnings;
use Getopt::Long qw(GetOptions);
use Locale::Po4a::Po;
+use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
-use Locale::gettext;
-use POSIX; # Needed for setlocale()
-
-setlocale(LC_MESSAGES, "");
textdomain('po4a');
sub show_version {
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.28
diff -u -p -r1.28 po4a
--- po4a 24 Apr 2005 01:09:24 -0000 1.28
+++ po4a 28 May 2005 18:12:03 -0000
@@ -201,10 +199,6 @@ use Pod::Usage qw(pod2usage);
use File::Temp;
-use Locale::gettext;
-use POSIX; # Needed for setlocale()
-
-setlocale(LC_MESSAGES, "");
textdomain('po4a');
Index: po4a-gettextize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-gettextize,v
retrieving revision 1.31
diff -u -p -r1.31 po4a-gettextize
--- po4a-gettextize 25 May 2005 16:34:06 -0000 1.31
+++ po4a-gettextize 28 May 2005 18:12:04 -0000
@@ -144,10 +142,6 @@ use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
-use Locale::gettext;
-use POSIX; # Needed for setlocale()
-
-setlocale(LC_MESSAGES, "");
textdomain('po4a');
Index: po4a-normalize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-normalize,v
retrieving revision 1.25
diff -u -p -r1.25 po4a-normalize
--- po4a-normalize 25 May 2005 16:34:06 -0000 1.25
+++ po4a-normalize 28 May 2005 18:12:04 -0000
@@ -95,12 +93,8 @@ use Locale::Po4a::Common;
use Getopt::Long qw(GetOptions);
-use Locale::gettext;
-use POSIX; # Needed for setlocale()
-
use Pod::Usage qw(pod2usage);
-setlocale(LC_MESSAGES, "");
textdomain('po4a');
sub show_version {
Index: po4a-translate
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-translate,v
retrieving revision 1.37
diff -u -p -r1.37 po4a-translate
--- po4a-translate 25 May 2005 16:34:13 -0000 1.37
+++ po4a-translate 28 May 2005 18:12:04 -0000
@@ -161,10 +159,6 @@ use Locale::Po4a::Common;
use Pod::Usage qw(pod2usage);
use Getopt::Long qw(GetOptions);
-use Locale::gettext;
-use POSIX; # Needed for setlocale()
-
-setlocale(LC_ALL, "");
textdomain("po4a");
sub show_version {
Index: po4a-updatepo
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-updatepo,v
retrieving revision 1.34
diff -u -p -r1.34 po4a-updatepo
--- po4a-updatepo 25 May 2005 16:34:13 -0000 1.34
+++ po4a-updatepo 28 May 2005 18:12:04 -0000
@@ -125,10 +123,6 @@ use Pod::Usage qw(pod2usage);
use File::Temp;
-use Locale::gettext;
-use POSIX; # Needed for setlocale()
-
-setlocale(LC_MESSAGES, "");
textdomain('po4a');
sub show_version {
Index: lib/Locale/Po4a/Chooser.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Chooser.pm,v
retrieving revision 1.26
diff -u -p -r1.26 Chooser.pm
--- lib/Locale/Po4a/Chooser.pm 25 May 2005 17:08:40 -0000 1.26
+++ lib/Locale/Po4a/Chooser.pm 28 May 2005 18:12:04 -0000
@@ -18,7 +18,6 @@ package Locale::Po4a::Chooser;
use 5.006;
use strict;
use warnings;
-use Locale::gettext;
use Locale::Po4a::Common;
sub new {
Index: lib/Locale/Po4a/Common.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Common.pm,v
retrieving revision 1.7
diff -u -p -r1.7 Common.pm
--- lib/Locale/Po4a/Common.pm 21 Mar 2005 10:11:59 -0000 1.7
+++ lib/Locale/Po4a/Common.pm 28 May 2005 18:12:04 -0000
@@ -24,12 +24,11 @@ package Locale::Po4a::Common;
require Exporter;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
-@EXPORT = qw(wrap_msg wrap_mod wrap_ref_mod load_config);
+@EXPORT = qw(wrap_msg wrap_mod wrap_ref_mod textdomain gettext dgettext load_config);
use 5.006;
use strict;
use warnings;
-use Locale::gettext;
use Text::WrapI18N qw(wrap $columns);
use Term::ReadKey;
@@ -51,6 +50,50 @@ sub min {
}
=head1 FUNCTIONS
+
+=head2 Wrappers for other modules
+
+=item textdomain($)
+
+This is a wrapper for Locale::gettext's textdomain() so that po4a still
+works if that module is missing. This wrapper also calls
+setlocale(LC_MESSAGES, "") so callers don't depend on the POSIX module either.
+
+=cut
+
+sub textdomain
+{
+ my ($domain)=@_;
+ return eval "use Locale::gettext; use POSIX; setlocale(LC_MESSAGES, ''); textdomain(\$domain)";
+}
+
+=item gettext($)
+
+This is a wrapper for Locale::gettext's gettext() so that things still
+work ok if that module is missing.
+
+=cut
+
+sub gettext
+{
+ my ($str)=@_;
+ my $rc=eval "use Locale::gettext; Locale::gettext::gettext(\$str)";
+ return ($@ ? $str : $rc);
+}
+
+=item dgettext($$)
+
+This is a wrapper for Locale::gettext's dgettext() so that things still
+work ok if that module is missing.
+
+=cut
+
+sub dgettext
+{
+ my ($domain, $str)=@_;
+ my $rc=eval "use Locale::gettext; dgettext(\$domain, \$str)";
+ return ($@ ? $str : $rc);
+}
=head2 Showing output messages
Index: lib/Locale/Po4a/Debconf.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Debconf.pm,v
retrieving revision 1.3
diff -u -p -r1.3 Debconf.pm
--- lib/Locale/Po4a/Debconf.pm 27 Feb 2005 22:53:52 -0000 1.3
+++ lib/Locale/Po4a/Debconf.pm 28 May 2005 18:12:04 -0000
@@ -68,7 +68,6 @@ use vars qw(@ISA @EXPORT);
use Locale::Po4a::TransTractor;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
sub initialize {}
Index: lib/Locale/Po4a/Html.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Html.pm,v
retrieving revision 1.10
diff -u -p -r1.10 Html.pm
--- lib/Locale/Po4a/Html.pm 7 Jan 2005 22:50:52 -0000 1.10
+++ lib/Locale/Po4a/Html.pm 28 May 2005 18:12:04 -0000
@@ -51,7 +51,6 @@ use vars qw(@ISA @EXPORT);
@EXPORT = qw(new initialize);
use Locale::Po4a::TransTractor;
-use Locale::gettext qw(gettext);
use strict;
use warnings;
Index: lib/Locale/Po4a/Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.91
diff -u -p -r1.91 Man.pm
--- lib/Locale/Po4a/Man.pm 25 May 2005 14:12:30 -0000 1.91
+++ lib/Locale/Po4a/Man.pm 28 May 2005 18:12:05 -0000
@@ -274,7 +274,6 @@ use strict;
@EXPORT = qw();# new initialize);
use Locale::Po4a::TransTractor;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
use File::Spec;
use Getopt::Std;
Index: lib/Locale/Po4a/NewsDebian.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/NewsDebian.pm,v
retrieving revision 1.3
diff -u -p -r1.3 NewsDebian.pm
--- lib/Locale/Po4a/NewsDebian.pm 27 Feb 2005 22:53:53 -0000 1.3
+++ lib/Locale/Po4a/NewsDebian.pm 28 May 2005 18:12:05 -0000
@@ -61,7 +61,6 @@ use vars qw(@ISA @EXPORT);
use Locale::Po4a::TransTractor;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
sub initialize {}
Index: lib/Locale/Po4a/Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.41
diff -u -p -r1.41 Po.pm
--- lib/Locale/Po4a/Po.pm 3 Apr 2005 21:15:22 -0000 1.41
+++ lib/Locale/Po4a/Po.pm 28 May 2005 18:12:06 -0000
@@ -57,7 +57,7 @@ require Exporter;
package Locale::Po4a::Po;
use Locale::Po4a::TransTractor;
-use Locale::Po4a::Common;
+use Locale::Po4a::Common qw(wrap_msg wrap_mod wrap_ref_mod dgettext);
use 5.006;
use strict;
@@ -70,7 +70,6 @@ require Exporter;
@EXPORT = qw(load write gettext);
use Carp qw(croak);
-use Locale::gettext qw(dgettext);
use File::Path; # mkdir before write
use Encode;
Index: lib/Locale/Po4a/Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.57
diff -u -p -r1.57 Sgml.pm
--- lib/Locale/Po4a/Sgml.pm 25 May 2005 16:55:20 -0000 1.57
+++ lib/Locale/Po4a/Sgml.pm 28 May 2005 18:12:06 -0000
@@ -176,7 +180,6 @@ use vars qw(@ISA @EXPORT);
use Locale::Po4a::TransTractor;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
eval qq{use SGMLS};
if ($@) {
Index: lib/Locale/Po4a/TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.58
diff -u -p -r1.58 TeX.pm
--- lib/Locale/Po4a/TeX.pm 23 Apr 2005 17:41:34 -0000 1.58
+++ lib/Locale/Po4a/TeX.pm 28 May 2005 18:12:07 -0000
@@ -80,7 +79,6 @@ $VERSION=$Locale::Po4a::TransTractor::VE
use Locale::Po4a::TransTractor;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
use File::Basename qw(dirname);
use Carp qw(croak);
Index: lib/Locale/Po4a/TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.66
diff -u -p -r1.66 TransTractor.pm
--- lib/Locale/Po4a/TransTractor.pm 25 May 2005 17:05:05 -0000 1.66
+++ lib/Locale/Po4a/TransTractor.pm 28 May 2005 18:12:08 -0000
@@ -20,7 +20,6 @@ use Carp qw(croak);
use Locale::Po4a::Po;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
use File::Path; # mkdir before write
use Encode;
Index: lib/Locale/Po4a/Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.27
diff -u -p -r1.27 Xml.pm
--- lib/Locale/Po4a/Xml.pm 21 May 2005 15:51:12 -0000 1.27
+++ lib/Locale/Po4a/Xml.pm 28 May 2005 18:12:08 -0000
@@ -59,7 +59,6 @@ use vars qw(@ISA @EXPORT);
use Locale::Po4a::TransTractor;
use Locale::Po4a::Common;
-use Locale::gettext qw(dgettext);
#It will mantain the path from the root tag to the current one
my @path;
19 years, 4 months
[Po4a-devel]Remove unneeded VERSION variables
by Francois Gouget
I noticed that a lot of sripts and packages import
TransTractor::VERSION. However I don't see this variable being used
anywhere. I suspect it was needed before the Common.pm module and its
show_version() function were added.
So I modified the scripts and removed these $VERSION variables. In the
msgsearch script I also modified the show_version() implementation to
reuse the one from Common.pm. This is in po4a-20050528-version1.diff.
I made a second patch for the modules because they not only import
TransTractor::VERSION., they also reexport it though I could not see it
used anywhere. I'll also note that not all of the modules do this (for
instance Sgml.pm does not). But just incase this was by design I put
this change in a separate patch: po4a-20050528-version2.diff.
I used po4a with these two changes and did not notice any negative effect.
po4a-20050528-version1.diff - Changelog:
* msgsearch
po4a
po4a-gettextize
po4a-normalize
po4a-translate
po4a-updatepo
Francois Gouget <fgouget(a)codeweavers.com>
Remove unneeded imports of TransTractor::VERSION.
po4a-20050528-version2.diff - Changelog:
* lib/Locale/Po4a/KernelHelp.pm
lib/Locale/Po4a/Man.pm
lib/Locale/Po4a/Po.pm
lib/Locale/Po4a/Pod.pm
lib/Locale/Po4a/TeX.pm
Francois Gouget <fgouget(a)codeweavers.com>
Remove unneeded imports and exports of TransTractor::VERSION.
--
Francois Gouget
fgouget(a)codeweavers.com
Index: msgsearch
===================================================================
RCS file: /cvsroot/po4a/po4a/msgsearch,v
retrieving revision 1.6
diff -u -p -r1.6 msgsearch
--- msgsearch 27 Feb 2005 22:56:00 -0000 1.6
+++ msgsearch 28 May 2005 18:12:03 -0000
@@ -9,7 +9,6 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
# This program is free software; you can redistribute it and/or modify it
# under the terms of GPL (see COPYING).
-my $VERSION=$Locale::Po4a::TransTractor::VERSION;
=head1 NAME
@@ -143,15 +142,8 @@ use warnings;
textdomain('po4a');
sub show_version {
- print sprintf(gettext(
- "%s version %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."
- ), "msgsearch", $VERSION)."\n";
+ Locale::Po4a::Common::show_version("msgsearch");
exit 0;
}
my ($help,@verbose,$input,$output);
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.28
diff -u -p -r1.28 po4a
--- po4a 24 Apr 2005 01:09:24 -0000 1.28
+++ po4a 28 May 2005 18:12:03 -0000
@@ -10,8 +10,6 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
# This program is free software; you can redistribute it and/or modify it
# under the terms of GPL (see COPYING).
-my $VERSION=$Locale::Po4a::TransTractor::VERSION;
-
=head1 NAME
po4a - update both the po files and translated documents in one shot
Index: po4a-gettextize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-gettextize,v
retrieving revision 1.31
diff -u -p -r1.31 po4a-gettextize
--- po4a-gettextize 25 May 2005 16:34:06 -0000 1.31
+++ po4a-gettextize 28 May 2005 18:12:04 -0000
@@ -10,8 +10,6 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
# This program is free software; you can redistribute it and/or modify it
# under the terms of GPL (see COPYING).
-my $VERSION=$Locale::Po4a::TransTractor::VERSION;
-
=head1 NAME
po4a-gettextize - convert an original file (and its translation) to a po file
Index: po4a-normalize
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-normalize,v
retrieving revision 1.25
diff -u -p -r1.25 po4a-normalize
--- po4a-normalize 25 May 2005 16:34:06 -0000 1.25
+++ po4a-normalize 28 May 2005 18:12:04 -0000
@@ -10,8 +10,6 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
# This program is free software; you can redistribute it and/or modify it
# under the terms of GPL (see COPYING).
-my $VERSION=$Locale::Po4a::TransTractor::VERSION;
-
=head1 NAME
po4a-normalize - normalize a documentation file by parsing it in po4a, and writing it back
Index: po4a-translate
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-translate,v
retrieving revision 1.37
diff -u -p -r1.37 po4a-translate
--- po4a-translate 25 May 2005 16:34:13 -0000 1.37
+++ po4a-translate 28 May 2005 18:12:04 -0000
@@ -10,8 +10,6 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
# This program is free software; you can redistribute it and/or modify it
# under the terms of GPL (see COPYING).
-my $VERSION=$Locale::Po4a::TransTractor::VERSION;
-
=head1 NAME
po4a-translate - convert a po file back to documentation format
Index: po4a-updatepo
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a-updatepo,v
retrieving revision 1.34
diff -u -p -r1.34 po4a-updatepo
--- po4a-updatepo 25 May 2005 16:34:13 -0000 1.34
+++ po4a-updatepo 28 May 2005 18:12:04 -0000
@@ -10,8 +10,6 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
# This program is free software; you can redistribute it and/or modify it
# under the terms of GPL (see COPYING).
-my $VERSION=$Locale::Po4a::TransTractor::VERSION;
-
=head1 NAME
po4a-updatepo - update the translation (in po format) of documentation
Index: lib/Locale/Po4a/KernelHelp.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/KernelHelp.pm,v
retrieving revision 1.12
diff -u -p -r1.12 KernelHelp.pm
--- lib/Locale/Po4a/KernelHelp.pm 27 Feb 2005 22:53:52 -0000 1.12
+++ lib/Locale/Po4a/KernelHelp.pm 28 May 2005 18:12:04 -0000
@@ -24,8 +24,7 @@ use warnings;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
-$VERSION=$Locale::Po4a::TransTractor::VERSION;
+use vars qw(@ISA @EXPORT $AUTOLOAD);
@ISA = qw(Locale::Po4a::TransTractor);
@EXPORT = qw(); # new process write read writepo readpo);
Index: lib/Locale/Po4a/Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.91
diff -u -p -r1.91 Man.pm
--- lib/Locale/Po4a/Man.pm 25 May 2005 14:12:30 -0000 1.91
+++ lib/Locale/Po4a/Man.pm 28 May 2005 18:12:05 -0000
@@ -274,8 +274,7 @@ use strict;
use warnings;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT);
-$VERSION=$Locale::Po4a::TransTractor::VERSION;
+use vars qw(@ISA @EXPORT);
@ISA = qw(Locale::Po4a::TransTractor);
@EXPORT = qw();# new initialize);
use Locale::Po4a::TransTractor;
Index: lib/Locale/Po4a/Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.41
diff -u -p -r1.41 Po.pm
--- lib/Locale/Po4a/Po.pm 3 Apr 2005 21:15:22 -0000 1.41
+++ lib/Locale/Po4a/Po.pm 28 May 2005 18:12:06 -0000
@@ -57,8 +57,7 @@ require Exporter;
use warnings;
use subs qw(makespace);
-use vars qw($VERSION @ISA @EXPORT);
-$VERSION=$Locale::Po4a::TransTractor::VERSION;
+use vars qw(@ISA @EXPORT);
@ISA = ();
@EXPORT = qw(load write gettext);
Index: lib/Locale/Po4a/Pod.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Pod.pm,v
retrieving revision 1.16
diff -u -p -r1.16 Pod.pm
--- lib/Locale/Po4a/Pod.pm 27 Feb 2005 22:53:53 -0000 1.16
+++ lib/Locale/Po4a/Pod.pm 28 May 2005 18:12:06 -0000
@@ -23,8 +23,7 @@ use warnings;
require Exporter;
-use vars qw($VERSION @ISA);
-$VERSION=$Locale::Po4a::TransTractor::VERSION;
+use vars qw(@ISA);
@ISA = qw(Locale::Po4a::TransTractor Pod::Parser);
sub initialize {}
Index: lib/Locale/Po4a/TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.58
diff -u -p -r1.58 TeX.pm
--- lib/Locale/Po4a/TeX.pm 23 Apr 2005 17:41:34 -0000 1.58
+++ lib/Locale/Po4a/TeX.pm 28 May 2005 18:12:07 -0000
@@ -68,8 +68,7 @@ use strict;
use warnings;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT);
-$VERSION=$Locale::Po4a::TransTractor::VERSION;
+use vars qw(@ISA @EXPORT);
@ISA = qw(Locale::Po4a::TransTractor);
@EXPORT = qw(%commands %environments
$RE_ESCAPE $ESCAPE
19 years, 4 months
[Po4a-devel]Sgml module does not translate the lang attribute
by Francois Gouget
I am putting po4a in place for the translation of the Wine
documentation. Pretty much the only issue is that the text generated by
DocBook itself, 'Table of Contents' for instance, is not translated. The
reason is that the language to use for this text is defined by the
'lang' attribute as in:
<book lang="en">
...
</book>
But the value of the lang attribute is passed as is by po4a-translate. I
checked the Sgml.pm module and indeed it does not have any provision for
translating attributes :-(
It looks like it should be done near this code (line 680):
if ($val->type() eq 'CDATA' ||
$val->type() eq 'IMPLIED') {
if (defined $value && length($value)) {
if ($value =~ m/"/) { #"
$value = "'".$value."'";
} else {
$value = '"'.$value.'"';
}
$tag .= ' '.lc($attr).'='.$value;
}
Unfortunately that's as far as I got and now I don't have any idea on
how to modify this code to add this functionality. Maybe if someone can
provide me some pointers...
--
Francois Gouget fgouget(a)free.fr http://fgouget.free.fr/
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.
19 years, 4 months
[Po4a-devel]$B?75,EPO?$NJ}$O(B10000$B1_J,L5NA(B
by info@specialtechnician.com
$B0lK|1_J,!*40A4L5NA$G;HMQ(BOK
$B"#:#$J$i4V$K9g$&(BW$B%A%c%s%9!*L5NA%]%$%s%H%"%C%W3Z$7$5(B100$BG\!*"#(B
$B"(EPO?=w@-2q0w$N%8%c%s%kJL?M5$%i%s%-%s%0(B
$B0l0L!'5U1g!J(B189$BL>EPO?!K(B
$BFs0L!'1g8r!J(B429$BL>EPO?!K(B
$B;00L!'(BSM$B5U1g!J(B243$BL>EPO?!K(B
$B;M0L!'%;%U%l!J(B1038$BL>EPO?!K(B
$B8^0L!'ITNQ!J(B2421$BL>EPO?!K(B
$BO;0L!'%F%l%(%C%A!J(B3463$BL>EPO?!K(B
$B!&(B
$B!&(B
$B!&(B
$B0lK|1_J,40A4L5NA$G$*;n$7$O(B
$B"-"-"-(B
http://www.awg4.com/?summer25
$BB~:#!*?75,EPO?$7$?J}$K$OL5NA$G(B10,000$B1_J,$4MxMQ=PMh$^$9!#(B
$B!ZL5NA%]%$%s%HFb$G==J,$K%Q!<%H%J!<$rC5$9;v$,=PMh$^$9!#![(B
$B"((B18$B:P0J>e$NHkL)87<i$G$-$kJ}$J$i2?J}$G$bMxMQ(BOK
$B"-"-F~8}"-"-(B
CLICK
http://www.awg4.com/?summer25
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$B"((B18$B:PL$K~$N$4MxMQ1sN82<$5$$!#(B
$B:#8e!"%a!<%k$N<u?.$r5qH]$9$k>l9g$O2<5-(BURL$B$KJV?.2<$5$$!#(B
henshin_senyou(a)ok.kz
19 years, 4 months
[Po4a-devel]Bug#310955: libtext-wrapi18n-perl: Please provide a "space preservation" option
by Martin Quinson
Package: libtext-wrapi18n-perl
Version: 0.06-1
Severity: wishlist
Hello,
I write to you as one of the po4a developpers. This project aims at easing
the translation of documentation using gettext in this area. Our programs
can for example take a man page, extract the strings to translate into a po
file and then (once the translator did their job) reinject the translated
strings into the man page structure. We can do so for man pages, for pod
(perl online documentation), xml, sgml, TeX and a few others. Enough for the
context, I guess.
po4a being localized itself, we use libtext-wrapi18n-perl to wrap our error
messages, but we don't use it to wrap the po file because your library is
missing a functionnality we need. In po files, all spaces are important and
newlines are not. So,
"toto "
"tutu"
is equivalent to
"toto tutu"
but not to
"toto"
"tutu"
(which is equivalent to "tototutu")
So, here is the purpose of this bug report: could you please add a way to
put linebreaks were needed in the sentence without removing any space (the
one at the end of the line come to mind), please?
Thanks a lot,
Mt.
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (400, 'testing'), (300, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-686
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)
Versions of packages libtext-wrapi18n-perl depends on:
ii libtext-charwidth-perl 0.04-1 get display widths of characters o
-- no debconf information
19 years, 4 months