From: barbier@linuxfr.org (Denis Barbier)
To: docbook-tools-discuss@sources.redhat.com
Subject: docbook2man and translated manpages, Act II
Date: Fri, 20 Dec 2002 19:23:00 -0000 [thread overview]
Message-ID: <20021014141603.GA32621@zobe.linuxfr.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 784 bytes --]
[I am not subscribed to this ML, please Cc me]
Hi Tim and others,
Here are your comments about the patch I sent to the Debian Bug Tracking
System, which is also attached:
> The problem with the patch is that it uses $LANG to determine the
> language that the document is written in---unfortunately, it just
> tells us the language that the current user is using, not the
> languange used by the document author. For that, we must use the
> current value of the 'lang' attribute. (That way a single document
> could contain all of the translations.)
Could you please have a second look on it?
Take any manpage written with docbook, replace
<refentry>
by
<refentry lang="xx">
and run docbook2man, it still generates foo.1
Now apply this patch and foo.xx.1 is generated.
Denis
[-- Attachment #2: docbook2man-spec.pl.patch --]
[-- Type: text/plain, Size: 803 bytes --]
--- docbook2man-spec.pl.orig Mon Jul 8 16:00:49 2002
+++ docbook2man-spec.pl Tue Jul 16 00:25:42 2002
@@ -244,6 +244,14 @@
$manpage_misc = '';
$list_nestlevel = 0; # Indent certain nested content.
+
+ # check refentry's language
+ if(defined($_[0]->attribute('LANG')->value)) {
+ $manpage_lang = $_[0]->attribute('LANG')->value;
+ }
+ else {
+ $manpage_lang = '';
+ }
});
sgml('</REFENTRY>', sub {
if(!$newline_last) {
@@ -256,7 +264,11 @@
});
sgml('</REFMETA>', sub {
- push_output('file', "$manpage_title.$manpage_sect");
+ if ($manpage_lang) {
+ push_output('file', "$manpage_title.$manpage_lang.$manpage_sect");
+ } else {
+ push_output('file', "$manpage_title.$manpage_sect");
+ }
output <<_END_BANNER;
.\\" This manpage has been automatically generated by docbook2man
WARNING: multiple messages have this Message-ID
From: barbier@linuxfr.org (Denis Barbier)
To: docbook-tools-discuss@sources.redhat.com
Subject: docbook2man and translated manpages, Act II
Date: Mon, 14 Oct 2002 07:17:00 -0000 [thread overview]
Message-ID: <20021014141603.GA32621@zobe.linuxfr.org> (raw)
Message-ID: <20021014071700.iWVNUNStOtJL4KKU-wBjOc_1AiVbCNUhZ3ujaN0rVSs@z> (raw)
[-- Attachment #1: Type: text/plain, Size: 784 bytes --]
[I am not subscribed to this ML, please Cc me]
Hi Tim and others,
Here are your comments about the patch I sent to the Debian Bug Tracking
System, which is also attached:
> The problem with the patch is that it uses $LANG to determine the
> language that the document is written in---unfortunately, it just
> tells us the language that the current user is using, not the
> languange used by the document author. For that, we must use the
> current value of the 'lang' attribute. (That way a single document
> could contain all of the translations.)
Could you please have a second look on it?
Take any manpage written with docbook, replace
<refentry>
by
<refentry lang="xx">
and run docbook2man, it still generates foo.1
Now apply this patch and foo.xx.1 is generated.
Denis
[-- Attachment #2: docbook2man-spec.pl.patch --]
[-- Type: text/plain, Size: 803 bytes --]
--- docbook2man-spec.pl.orig Mon Jul 8 16:00:49 2002
+++ docbook2man-spec.pl Tue Jul 16 00:25:42 2002
@@ -244,6 +244,14 @@
$manpage_misc = '';
$list_nestlevel = 0; # Indent certain nested content.
+
+ # check refentry's language
+ if(defined($_[0]->attribute('LANG')->value)) {
+ $manpage_lang = $_[0]->attribute('LANG')->value;
+ }
+ else {
+ $manpage_lang = '';
+ }
});
sgml('</REFENTRY>', sub {
if(!$newline_last) {
@@ -256,7 +264,11 @@
});
sgml('</REFMETA>', sub {
- push_output('file', "$manpage_title.$manpage_sect");
+ if ($manpage_lang) {
+ push_output('file', "$manpage_title.$manpage_lang.$manpage_sect");
+ } else {
+ push_output('file', "$manpage_title.$manpage_sect");
+ }
output <<_END_BANNER;
.\\" This manpage has been automatically generated by docbook2man
next reply other threads:[~2002-10-14 14:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-20 19:23 Denis Barbier [this message]
2002-10-14 7:17 ` Denis Barbier
2002-12-20 19:23 ` Tim Waugh
2002-10-14 7:22 ` Tim Waugh
2002-12-20 19:23 ` Denis Barbier
2002-10-14 7:47 ` Denis Barbier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021014141603.GA32621@zobe.linuxfr.org \
--to=barbier@linuxfr.org \
--cc=docbook-tools-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).