From: Brian Candler Date: 2003-07-01T22:48:21+09:00 Subject: Re: Message catalogs (I18N) overnight hack... On Tue, Jul 01, 2003 at 10:25:51PM +0900, Hal E. Fulton wrote: > But there are several little issues like that, that I'm not addressing yet. > Someone mentioned the decimal point issue. I hate to think about that. And then you get into date formats (US middle-endian), three-letter abbreviations for month names, ... ugh. I'm sure these problems must have been gone through before. I noted a while ago under FreeBSD that gmake had some strange dependencies: # pkg_add gmake-3.79.1_1.tgz pkg_add: could not find package libiconv-1.7_5 ! pkg_add: could not find package expat-1.95.2 ! pkg_add: could not find package gettext-0.11.1_3 ! It seemed strange to me that a 'make' utility would have a dependency on an XML parser. It turns out that gettext is the GNU way to deal with this: [man gettext] DESCRIPTION The gettext program translates a natural language message into the user's language, by looking up the translation in a message catalog. I imagine that the source format for these message catalogues is XML, and hence the requirement on an XML parser (although IMO gettext should be split into two: a client side which just reads the message catalogues, which appear to be in a binary format, and a -devel package which includes the XML-to-message-catalogue tools. But I digress). I note there's a ruby-gettext library already. A quick browse and it seems to require indexing by message-ID rather than the original "untranslated" text. That approach makes logical sense to me - decouple *all* language text from the source, rather than have language A in the source and languages A,B,C,D in the translation database. (Otherwise, whenever you change a message in the source you'd have to update the corresponding language A entry - a violation of the DRY principle) Cheers, Brian.