From owner-freebsd-i18n Wed Apr 18 2:14:29 2001 Delivered-To: freebsd-i18n@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 0F73B37B423 for ; Wed, 18 Apr 2001 02:14:21 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f3I9DJq52986; Wed, 18 Apr 2001 12:13:19 +0300 (EEST) (envelope-from ru) Date: Wed, 18 Apr 2001 12:13:19 +0300 From: Ruslan Ermilov To: =?koi8-r?B?4c7E0sXKIP7F0s7P1w==?= Cc: i18n@FreeBSD.ORG, ru-cvs-all@FreeBSD.org.ua Subject: Re: -mdoc localization support (was: Re: ** HEADS UP ** Groff 1.17 (including -mdocNG) imported) Message-ID: <20010418121319.A48752@sunbay.com> References: <20010417163318.A47398@sunbay.com> <20010417173754.A19540@nagual.pp.ru> <20010417170419.C47398@sunbay.com> <20010417183933.C20680@nagual.pp.ru> <20010417184742.A61775@sunbay.com> <20010418124114.A33411@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <20010418124114.A33411@nagual.pp.ru>; from ache@nagual.pp.ru on Wed, Apr 18, 2001 at 12:41:16PM +0400 Sender: owner-freebsd-i18n@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Apr 18, 2001 at 12:41:16PM +0400, Андрей Чернов wrote: > On Tue, Apr 17, 2001 at 18:47:42 +0300, Ruslan Ermilov wrote: > > 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: > > Please explain first the need of this prologue (I don't understand why any > special processing ever needed). F.e. I can view English manpage in > KOI8-R locale in old variant because English is subset of KOI8-R. So, I > can view Russian manpage too, I see no difference or any prologue needs. > In the old -mdoc, KOI8-R locale support was implemented like this: 1. tmac.doc loaded tmac/mdoc/locale/locale-list 2. locale-list checked the value of \*[.T] variable (the argument to the troff(1)'s -T flag), and if that is "koi8-r", simply loaded localization file, mdoc/locale/koi8-r. Neither this is necessary for English manpages, nor this is longer works because of the "dirrerences in implementation". Old -mdoc localization worked by extending some macros and implementing a few locale macros. This is no longer needed with new -mdoc, see at the actual implementation in src/gnu/usr.bin/groff/tmac/koi8-r to get the idea. 3. Current implementation still bogusly loads locale file (koi8-r) if \*[.T] variable is "koi8-r", but loading koi8-r locale file now _overwrites_ some -mdoc variables with localized values, e.g. standard section names, library names, etc., i.e. it assumes that the manpage is in ru_RU.KOI8-R. Got it? So we need another way to specify the language of the manual page being processed. I proposed that we add the \*[doc-lang] variable, similar to the $LANG environment variable. One way to set it is the prologue line in every localized manpage, similar to how this is done in calendar(1). Another way is to have man(1) automatically set this variable depending on the share/man subdirectory like this: /usr/bin/groff -S -Wall -mtty-char -man -Tkoi8-r -dlang=ru.KOI8-R The first one has an advantage that the page will be displayed correctly irrespective of its actual location, but has an obvious disadvantage of forcing every single manpage to have the prologue line. The second one has their advantages and disadvantages reversed. 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-i18n" in the body of the message