Date: Thu, 24 May 2001 20:38:38 +0300 From: "Eli Zaretskii" To: haible@ilog.fr, handa@etl.go.jp Cc: emacs-pretest-bug@gnu.org, keichwa@gmx.net, translation@IRO.UMontreal.CA, haible@ilog.fr, pablo@mandrakesoft.com, primoz.peterlin@biofiz.mf.uni-lj.si, pinard@IRO.UMontreal.CA Subject: Re: PO files and Emacs (coding:) Message-Id: <2950-Thu24May2001203837+0300-eliz@is.elta.co.il> References: <15115.49289.625922.181172@honolulu.ilog.fr> <15116.16898.335177.134247@honolulu.ilog.fr> MIME-Version: 1.0 > From: Bruno Haible > Date: Thu, 24 May 2001 01:04:34 +0200 (CEST) > > PO file support consists of two parts: > > 1) Make sure that Emacs displays the file in the right encoding. > All PO files contains multilingual text; the right choice of > coding-system is essential for them. > > 2) A special editing mode for use by translators (po-mode.el by > Francois Pinard et al.) > > I would like to push part 1) into Emacs. Part 2) is probably best > maintained as part of gettext. Personally, I think po-mode.el should be part of Emacs. If Karl (or someone else) wants to remain its maintainer, it can be easily arranged, so the danger of losing control over its development does not need to bother you. But of course, this is something the current po-mode maintainer(s) should decide. > The support consists of three parts. > 1) A new file, attached to this mail. Thanks. Some comments below. > 2) Make sure that loaddefs.el scans that new file for autoloads. > > I don't know how to do this. This is done automatically when the distribution is tarred. There's a special target in lisp/Makefile ("make autoloads") which updates loaddefs.el. > 3) Put the following form into startup.el or any other files that is > included by startup.el in all cases: > > (modify-coding-system-alist 'file "\\.po[tx]?\\'\\|\\.po\\." > 'po-find-file-coding-system) Shouldn't this go into lisp/international/mule-conf.el, where the default value of file-coding-system-alist is set up? Also, at least the *.pot files are pure ASCII, no? > ;;; po.el --- basic support of PO translation files -*- coding: utf-8; -*- This is not a good idea: Emacs does not yet support Unicode well enough to distribute files encoded in UTF. It seems like the only non-ASCII characters in this file are Latin-1 characters in a name of the author, so latin-1 encoding should be good enough. If you would like a more general encoding, please use iso-2022-7bit. > (defconst po-content-type-charset-alist > '(; Note: Emacs 21 doesn't support all encodings, thus the missing en= > tries. > (ASCII . undecided) > (ANSI_X3.4-1968 . undecided) > (US-ASCII . undecided) > (ISO-8859-1 . iso-8859-1) > (ISO_8859-1 . iso-8859-1) I don't understand why do you need the upper-case variety: it should be enough to downcase the original name, as the code already does. > ;(ISO-8859-6 . ??) Emacs doesn't yet support Arabic :-(. > ;(ISO-8859-13 . ??) Not supported yet. > ;(ISO-8859-15 . ??) This is supported: use iso-8859-15. > ;(CP850 . ??) Are there really *.po files encoded in cpNNN? I don't think I saw these in the list of charsets taht the robot says it supports. Anyway, most of these are supported, and Emacs calls them cpNNN, so just use them. One caveat: cpNNN systems need to be created before they can be used. To create a cpNNN coding system, evaluate this expression: (codepage-setup NNN) where NNN is the number of the codepage; it can be given either as a string "NNN" or as a number. > ;(GB2312 . euc-cn) > ;(EUC-JP . euc-jp) > ;(EUC-KR . euc-kr) > ;(BIG5 . big5) > ;(SJIS . shift_jis) > ;(VISCII . viscii) Why did you comment these out? > ;(EUC-TW . ??) Unsupported, I think. > ;(BIG5HKSCS . ??) > ;(GBK . ??) > ;(GB18030 . ??) > ;(JOHAB . ??) Don't know anything about these. > ;(TIS-620 . th-tis620) Use tis-620. > (if (memq charset-lower (coding-system-list)) > charset-lower > 'no-conversion)))) I think it is much more efficient to use coding-system-p instead of looking in the result of (coding-system-list). Handa-san, could you please comment on that (and also on the charsets shown above)? Thanks again for your contribution.