From: Egmont K. <eg...@uh...> - 2006-05-29 14:25:25
|
On Tue, May 23, 2006 at 07:08:46PM -0400, Joseph H Allen wrote: Hi, > Switch to my own gettext() library. > > I too have been having these problems, depending on the system, so I've just > checked in a new version: I've decided that I'm not going to rely on the > system's gettext and I'm not including GNU-gettext with JOE. Instead, I've > written my own. A major benefit of using my own is that these compile > problems go away, and JOE remains dependency free. > > So now when you type make install, the po/*.po files just get copied to > /etc/joe/lang. JOE will read the .po files directly, so there is no need > for the binary .gmo or .mo files (but this may change). Could this be a compile time option? I'm using a Linux system, here there's absolutely no problem with the gettext system, it doesn't bring run-time dependency (as it's part of glibc), and it's so ugly to see individual solutions for problems that have common well-known solution. (We're building a distro and have several scripts handling /usr/share/locale/*/*/*.mo files. For example languages not supported by our installer are dropped from the installer's code to save space. Here then we'd need to take special care of joe, since the current file dropping rules would keep all its languages. Other example: since our distro is fully UTF-8, we automatically convert all the .mo files to UTF-8 during package build, so that we save run-time CPU time by avoiding the need of converting. This is again an issue which should need special attention regarding joe. It would be so nice to see joe smoothly integrating to the rest of the system.) BTW there's an off-by-one bug when parsing the charset of the .po file. Currently in row 84 of gettext.c the code to jump over the "charset=" text is this: p += sizeof("charset="); but sizeof() includes the terminating zero, hence if my file is encoded in UTF-8, joe tries to look up the charset called "TF-8". It should be strlen() or a hard-coded constant of 8 (as this text is unlikely to change). -- Egmont |