From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8722 Path: main.gmane.org!not-for-mail From: visigoth@naiad.fac.cs.cmu.edu Newsgroups: gmane.emacs.gnus.general Subject: Re: Internationalization Date: 10 Nov 1996 19:25:42 -0500 Sender: visigoth@naiad.fac.cs.cmu.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148850 13975 80.91.224.250 (20 Oct 2002 21:20:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:20:50 +0000 (UTC) Return-Path: Original-Received: (qmail 23729 invoked from smtpd); 11 Nov 1996 00:41:45 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 11 Nov 1996 00:41:44 -0000 Original-Received: from naiad.fac.cs.cmu.edu (NAIAD.FAC.CS.CMU.EDU [128.2.191.173]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Mon, 11 Nov 1996 01:26:02 +0100 Original-To: ding@ifi.uio.no In-Reply-To: Lars Magne Ingebrigtsen's message of 10 Nov 1996 16:31:18 +0100 Original-Lines: 57 X-Mailer: Red Gnus v0.55/XEmacs 19.14 Source-Info: Sender is really visigoth@naiad.fac.cs.cmu.edu Xref: main.gmane.org gmane.emacs.gnus.general:8722 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8722 Lars Magne Ingebrigtsen writes: > If such a thing was to be done, how should one do it? Has there been > done work in this area for other Elisp packages? > > Hm... One could create mappings from the English prompts and messages > to the current countries' prompts and messages, using a hash table. > Providing that the different messages are unique in English. Then one > just has to wrap all string in the source code with `(gnus-map "The > string")', and the `gnus-map' function could use a hash table built > from the tranlation file for the country during loadup... Hm... How > should the translations be specified in the translation files? Uhm, > that could be done easily enough, with just about any syntax, with the > English originals as comments. The skeleton translation file(s) could > be generated automatically by just looking for the `gnus-map' calls in > the source files... This sounds like an interesting way to start--I suspect that it would be useful after a time to move the English version out to a file as well. So you would have something like: (in gnus-art.el, lines around 386:) (format prompt (if (and gnus-number-of-articles-to-be-saved (> gnus number-of-articles-to-be-saved 1)) (format (gnus-get-trans 'these-articles) gnus-number-of-articles-to-be-saved) (gnus-get-trans 'this-article))) On the other hand--that's really damned ugly. Hmm. It would be nice if there were some better guarantee that things still work even when a string changes, that would be good. Maybe use a combination of these two strategies. (gnus-map "these %d articles" 'these-articles) So this would use "these %d articles" if the language was set to use the default strings, or look it up from the translation list using the symbol. This way, if the string changes, the symbol can stay the same. If it changes drastically, it's perhaps easier to recall that it needs to be changed elsewhere, too. And finally, you could also do something like: gnus-text-these-D-articles => "these %d articles" or the translation--and have a loaded file which sets up the mappings. I suppose this just wastes a lot of namespace, though. The real problem is that anything that's easy to convert to from having the quotes in-line has the consistency problem--and any other method sort of uglifies things. And the real problem, unfortunately, is documentation strings. John.