public inbox for docbook-tools-discuss@sourceware.org
 help / color / mirror / Atom feed
* docbook2man and translated manpages, Act II
  2002-12-20 19:23 docbook2man and translated manpages, Act II Denis Barbier
@ 2002-10-14  7:17 ` Denis Barbier
  2002-12-20 19:23 ` Tim Waugh
  1 sibling, 0 replies; 6+ messages in thread
From: Denis Barbier @ 2002-10-14  7:17 UTC (permalink / raw)
  To: docbook-tools-discuss

[-- 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 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: docbook2man and translated manpages, Act II
  2002-12-20 19:23 ` Tim Waugh
@ 2002-10-14  7:22   ` Tim Waugh
  2002-12-20 19:23   ` Denis Barbier
  1 sibling, 0 replies; 6+ messages in thread
From: Tim Waugh @ 2002-10-14  7:22 UTC (permalink / raw)
  To: Denis Barbier; +Cc: docbook-tools-discuss

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

On Mon, Oct 14, 2002 at 04:16:03PM +0200, Denis Barbier wrote:

> Could you please have a second look on it?

Oh, I'm very sorry---I must have only glanced at the patch.  I've
applied it now.

Thanks,
Tim.
*/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: docbook2man and translated manpages, Act II
  2002-12-20 19:23   ` Denis Barbier
@ 2002-10-14  7:47     ` Denis Barbier
  0 siblings, 0 replies; 6+ messages in thread
From: Denis Barbier @ 2002-10-14  7:47 UTC (permalink / raw)
  To: docbook-tools-discuss

On Mon, Oct 14, 2002 at 03:22:36PM +0100, Tim Waugh wrote:
> On Mon, Oct 14, 2002 at 04:16:03PM +0200, Denis Barbier wrote:
> 
> > Could you please have a second look on it?
> 
> Oh, I'm very sorry---I must have only glanced at the patch.  I've
> applied it now.

Thanks Tim.
Note that I am not an SGMLS guru, so please check it twice ;)

Denis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: docbook2man and translated manpages, Act II
  2002-12-20 19:23 docbook2man and translated manpages, Act II Denis Barbier
  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
  1 sibling, 2 replies; 6+ messages in thread
From: Tim Waugh @ 2002-12-20 19:23 UTC (permalink / raw)
  To: Denis Barbier; +Cc: docbook-tools-discuss

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

On Mon, Oct 14, 2002 at 04:16:03PM +0200, Denis Barbier wrote:

> Could you please have a second look on it?

Oh, I'm very sorry---I must have only glanced at the patch.  I've
applied it now.

Thanks,
Tim.
*/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: docbook2man and translated manpages, Act II
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Denis Barbier @ 2002-12-20 19:23 UTC (permalink / raw)
  To: docbook-tools-discuss

On Mon, Oct 14, 2002 at 03:22:36PM +0100, Tim Waugh wrote:
> On Mon, Oct 14, 2002 at 04:16:03PM +0200, Denis Barbier wrote:
> 
> > Could you please have a second look on it?
> 
> Oh, I'm very sorry---I must have only glanced at the patch.  I've
> applied it now.

Thanks Tim.
Note that I am not an SGMLS guru, so please check it twice ;)

Denis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* docbook2man and translated manpages, Act II
@ 2002-12-20 19:23 Denis Barbier
  2002-10-14  7:17 ` Denis Barbier
  2002-12-20 19:23 ` Tim Waugh
  0 siblings, 2 replies; 6+ messages in thread
From: Denis Barbier @ 2002-12-20 19:23 UTC (permalink / raw)
  To: docbook-tools-discuss

[-- 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 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-10-14 14:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20 19:23 docbook2man and translated manpages, Act II Denis Barbier
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

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).