www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/04/21/02:43:00

Date: Fri, 21 Apr 2000 03:39:54 -0400 (EDT)
Message-Id: <200004210739.DAA16973@indy.delorie.com>
From: Eli Zaretskii <eliz AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <18478AC39D3@HRZ1.hrz.tu-darmstadt.de>
(ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De)
Subject: GNU Gettext and NLS support for DJGPP
References: <18478AC39D3 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

I think there's a need to discuss the way we want gettext to work with
DJGPP ports.  Let me begin this discussion by presenting the problem
and the possible solutions.

Gettext works by providing, for each package, a catalog of strings
used by that package.  For each supported language FOO, there is a
corresponding FOO.po file (e.g., de.po for German, ko.po for Korean,
pt.po for Portuguese, etc.) which holds translations of each of these
strings to that language.  At run time, a special function is called
to translate each string before it is printed, by looking up the
translation in the corresponding .po file.

The problem is that the *.po files distributed with GNU packages are
encoded using coding schemes used on Unix systems, which are different
from the DOS codepages.  For example, West-European languages usually
come in the ISO 8859-1 encoding, which is different from the
corresponding DOS codepage 851.

It is possible to convert the *.po files to DOS codepages, e.g. using
the `recode' program.  However, this conversion should be done
manually by each user, since the Makefile's supplied by the GNU
packages don't have provisions for running any such programs when you
say "make install".

Another possibility is to perform the translation on the fly, at run
time.  This would mean we need to augment the gettext sources with
additional code that would convert all non-ASCII characters from their
Unix encoding to the corresponding DOS encoding.  One possible way to
get this code for free is to link against librecode.a which is part of
the `recode' package.

I favor the second alternative, but it means some additional work on
the gettext port.

Any comments are welcome.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019