[xml/sgml-pkgs] Bug#394511: docbook-utils: docbook2man should translate the NAME section according to the REFENTRY's lang attribute

Nicolas François nicolas.francois at centraliens.net
Sat Oct 21 15:14:25 UTC 2006


Package: docbook-utils
Version: 0.6.14-1
Severity: normal
Tags: patch l10n

Hello,

Currently, docbook2man translates the NAME section according to the lang
attribute provided to the REFNAMEDIV tag.
When a lang attribute is specified in the REFENTRY tag and no lang
attribute is specified with the REFNAMEDIV, the lang attribute of the
REFENTRY should be used.

A patch is attached.

Kind Regards,
-- 
Nekral
-------------- next part --------------
diff -rauN ../orig/docbook-utils-0.6.14/helpers/docbook2man-spec.pl ./docbook-utils-0.6.14/helpers/docbook2man-spec.pl
--- ../orig/docbook-utils-0.6.14/helpers/docbook2man-spec.pl	2003-06-10 10:30:30.000000000 +0200
+++ ./docbook-utils-0.6.14/helpers/docbook2man-spec.pl	2006-10-21 00:48:33.000000000 +0200
@@ -358,11 +358,14 @@
 # NAME section
 man_sgml('<REFNAMEDIV>', sub {
 	my %words = qw( fr NOM es NOMBRE de NAME );
-	if (defined($_[0]->attribute('LANG')->value)) {
-	my $id = $_[0]->attribute('LANG')->value;
-	my $ad = $words{$id};
-	output("\n.SH $ad\n");}
-	else {output("\n.SH NAME\n");}
+	# Use the REFNAMEDIV's lang attribute, and default to the
+	# REFENTRY's lang attribute.
+	my $lang = $_[0]->attribute('LANG')->value;
+	$lang = $manpage_lang unless defined $lang;
+	if (defined($lang) and defined $words{lc($lang)}) {
+		my $ad = $words{lc($lang)};
+		output("\n.SH $ad\n");}
+	else {	output("\n.SH NAME\n");}
 });
 
 sgml('<REFNAME>', \&save_cdata);


More information about the debian-xml-sgml-pkgs mailing list