From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8794 Path: main.gmane.org!not-for-mail From: Ralph Schleicher Newsgroups: gmane.emacs.gnus.general Subject: Re: Internationalization Date: 14 Nov 1996 20:27:31 +0100 Message-ID: References: <199611132205.OAA26260@newman.in.aventail.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035148911 14386 80.91.224.250 (20 Oct 2002 21:21:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:21:51 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: Original-Received: (qmail 3497 invoked from smtpd); 15 Nov 1996 06:44:16 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 15 Nov 1996 06:44:15 -0000 Original-Received: from happy.informatik.uni-ulm.de (root@happy.informatik.uni-ulm.de [134.60.68.63]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Fri, 15 Nov 1996 07:18:42 +0100 Original-Received: from donau by happy.informatik.uni-ulm.de with uucp (Smail3.2 #1) id m0vOHbs-0000XHC; Fri, 15 Nov 1996 07:18:40 +0100 (MET) Original-Received: by donau.in-ulm.de (/\==/\ Smail3.1.25.1 #25.10) id ; Fri, 15 Nov 96 06:40 MET Original-Received: from bravo.purple.UL.BaWue.DE (rs@bravo.purple.UL.BaWue.DE [192.168.42.2]) by alfa.purple.UL.BaWue.DE (8.6.10/8.6.10) with ESMTP id UAA22694; Thu, 14 Nov 1996 20:29:24 +0100 Original-Received: (from rs@localhost) by bravo.purple.UL.BaWue.DE (8.6.10/8.6.10) id UAA10697; Thu, 14 Nov 1996 20:27:32 +0100 Original-To: wmperry@aventail.com In-Reply-To: William Perry's message of Wed, 13 Nov 1996 14:05:55 -0800 Original-Lines: 41 X-Mailer: Gnus v5.2.40/Emacs 19.30 Xref: main.gmane.org gmane.emacs.gnus.general:8794 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8794 William Perry cited below with "WP" writes: WP> This patch would probably work just fine on XEmacs. I'll give it a whirl WP> this weekend maybe.... if I don't spend it all babying the baby. Sick WP> toddlers aren't conducive to hacking. :) I couldn't follow the complete thread so please allow me hooking in here. Lars's patch is a little bit too simple. You should treat every Emacs buffer as an independent domain. With Lars's patch, `_' have to be an alias for (progn (set-translation-domain DOMAIN) (translate-string MESSAGE)) I think that the following definition is better suited for Emacs (`gettext-domain' and `gettext-locale' are buffer-local variables). (defun gettext (domain message &optional locale) "Look up MESSAGE in the DOMAIN message catalog. If not found, returns MESSAGE itself (the default text). If DOMAIN is `nil', then look up MESSAGE in the current domain. If DOMAIN is `\"\"', then look up MESSAGE in the `\"messages\"' domain. Optional third argument LOCALE overrides the current locale." (cond ((equal domain nil) (setq domain gettext-domain)) ((equal domain "") (setq domain "messages"))) (cond ((equal locale nil) (setq locale gettext-locale)) ((equal locale "") (setq locale "POSIX"))) (let* ((messages (gettext-find-messages domain locale)) (symbol (and messages (intern-soft message messages)))) (or (symbol-value symbol) message))) -- Ralph * http://www.UL.BaWue.DE/~rs/ GNU -- vivat, crescat, floreat!