Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2001 18:47:42 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        "Andrey A. Chernov" <ache@nagual.pp.ru>
Cc:        i18n@FreeBSD.ORG, ru-cvs-all@FreeBSD.org.ua
Subject:   -mdoc localization support (was: Re: ** HEADS UP ** Groff 1.17 (including -mdocNG) imported)
Message-ID:  <20010417184742.A61775@sunbay.com>
In-Reply-To: <20010417183933.C20680@nagual.pp.ru>; from ache@nagual.pp.ru on Tue, Apr 17, 2001 at 06:39:34PM %2B0400
References:  <20010417163318.A47398@sunbay.com> <20010417173754.A19540@nagual.pp.ru> <20010417170419.C47398@sunbay.com> <20010417183933.C20680@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
[Redirected to -i18n]

On Tue, Apr 17, 2001 at 06:39:34PM +0400, Andrey A. Chernov wrote:
> On Tue, Apr 17, 2001 at 17:04:19 +0300, Ruslan Ermilov wrote:
[...]
> 
> > difference in implementation (the current implementation simply redefines
> > some -mdoc string variables), if you run ``nroff -mdoc'' for English manpage,
> > and your LANG environment variable is set to ru_RU.KOI8-R, you will get the
> > corrupted output.
> 
> This is unacceptable and must be fixed soon (LANG supposed to be always
> set for Russians, and requiring extra argument for nroff is very
> contr-intuitive in the light of the fact that old version works without
> it).
> 
Sure, just wanted to discuss the change first.  :-)

Here is the solution I can come up with right now.

Every localized manpage should include one prologue line (similar to
how this is done in calendar(1) files) that will set locale language
to be used.   For example, Russian manual pages would look like this:

Index: apropos.1
===================================================================
RCS file: /home/rucvs/frdp/doc/ru_RU.KOI8-R/man/man1/apropos.1,v
retrieving revision 1.2
diff -u -p -r1.2 apropos.1
--- apropos.1	2001/02/09 13:47:42	1.2
+++ apropos.1	2001/04/17 15:23:14
@@ -16,6 +16,7 @@
 .\" $FreeBSDru: frdp/doc/ru_RU.KOI8-R/man/man1/apropos.1,v 1.2 2001/02/09 13:47:42 ru Exp $
 .\" Original revision: 1.5.2.2
 .\"
+.ds lang ru_RU.KOI8-R
 .Dd 15 января 1991
 .Dt APROPOS 1
 .Os


Then, mdoc.local script would load locale-specific file depending on the
value of that variable:

Index: mdoc.local
===================================================================
RCS file: /home/ncvs/src/gnu/usr.bin/groff/tmac/mdoc.local,v
retrieving revision 1.1
diff -u -p -r1.1 mdoc.local
--- mdoc.local	2001/04/17 12:37:18	1.1
+++ mdoc.local	2001/04/17 15:35:37
@@ -58,5 +58,7 @@
 .ds doc-operating-system FreeBSD\~5.0
 .
 .
-.\" KOI8-R locale support
-.if "\*[.T]"koi8-r" .mso mdoc/koi8-r
+.\" Locale support
+.if d doc-lang \{\
+.  if "\*[doc-lang]"ru_RU.KOI8-R" .mso mdoc/koi8-r
+.\}

Note that the "doc-" prefix is stripped when mdoc-local is installed.
Does this looks acceptable to you?


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010417184742.A61775>