From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8721 Path: main.gmane.org!not-for-mail From: "David Kågedal" Newsgroups: gmane.emacs.gnus.general Subject: Re: Internationalization Date: 10 Nov 1996 20:02:41 +0100 Sender: davidk@lysator.liu.se Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035148849 13973 80.91.224.250 (20 Oct 2002 21:20:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:20:49 +0000 (UTC) Return-Path: Original-Received: (qmail 21529 invoked from smtpd); 10 Nov 1996 19:21:03 -0000 Original-Received: from riker.diamond-lane.net (root@206.190.83.4) by deanna.miranova.com with SMTP; 10 Nov 1996 19:21:03 -0000 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by riker.diamond-lane.net (8.8.2/8.8.0) with SMTP id LAA04829 for ; Sun, 10 Nov 1996 11:24:19 -0800 Original-Received: from lysander.lysator.liu.se (mailhost.lysator.liu.se [130.236.254.3]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sun, 10 Nov 1996 20:02:57 +0100 Original-Received: from tintin.lysator.liu.se (davidk@tintin.lysator.liu.se [130.236.254.61]) by lysander.lysator.liu.se (8.8.2/8.8.2) with ESMTP id UAA11837; Sun, 10 Nov 1996 20:02:54 +0100 (MET) Original-Received: (from davidk@localhost) by tintin.lysator.liu.se (8.8.2/8.8.2) id UAA12833; Sun, 10 Nov 1996 20:02:46 +0100 (MET) Original-To: ding@ifi.uio.no X-Face: D]XdQ0Lvl](98/?#ke.70P&g#NMUCf!)RIE}'k~=+N;#R2uW:$?JwjbU*jlrOh<0}LlKrwJ '+U#I_Mg|YVK\yHGVs`iy-^RoC(Sq'H3Bv*&'aL`!\Sk?[ Y^soDZ`fP_My5y282q2T 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? Yes, it has been done. We here at Lysator have our own conferncing system, LysKOM, with an Emacs client. (More information at (in Swedish) and ). This elisp client is available in both Swedish and English, and in the latest, unreleased, version it is possible to switch languages while running. All strings are retrieved with (lyskom-get 'string-symbol), and in the latest version you can also specify a message catalogue as an optional second argument. It was implemented as a simple alist before, but we have now moved to useing symbol properties instead. We use symbols to identify the strings. I don't believe it would be a good idea to use strings for that. Now for some example code: ;; lyskom-get-string gets a string from a message catalog (category) (defsubst lyskom-get-string-internal (symbol category) (cdr (assq lyskom-language (get symbol category)))) (defsubst lyskom-get-string-error (function symbol category) (signal 'lyskom-internal-error (list function (list symbol category ": string not found")))) (defun lyskom-get-string (symbol &optional category) "Returns string assiciated with SYMBOL" (or (lyskom-get-string-internal symbol (or category 'lyskom-message)) (lyskom-get-string-error 'lyskom-get-string symbol (or category 'lyskom-message)))) ;; From file swedish-strings.el (lyskom-language-strings lyskom-message sv '( (server-q . "LysKOM-server? (%#1s) ") (try-connect . "LysKOM elisp-klient version %#1s.\nF\366rs\366ker kop= pla upp mot %#2s.\n") (protocoll-error . "Protocol error. Servers says: %#1s") (connection-done . "Uppkopplingen klar. Serverns versionsnummer \344r= %#1s.\n\n") (what-is-your-name . "Vad heter du? ") (password . "L\366senord? ") (wrong-password . "Fel l\366sen.\n") (are-logged-in . "Du \344r nu inloggad. V\344nta ett tag.\n") (you-have-motd . "\nDu har en lapp p\345 d\366rren:\n\n") ...)) ;; From file english-strings.el (lyskom-language-strings lyskom-message en=20 '( (server-q . "LysKOM server? (%#1s) ") (try-connect . "LysKOM elisp client version %#1s.\nAttempting to conn= ect to %#2s.\n") (protocoll-error . "Protocol error. Servers says: %#1s") (connection-done . "Connection established. Server version is %#1s.\n= \n") (what-is-your-name . "What is your name? ") (password . "Your Password? ") (wrong-password . "Incorrect password\n") (are-logged-in . "You have entered LysKOM. Please wait...\n") (you-have-motd . "\nYou have a note on your door:\n\n") ...)) We also have language-dependent keymaps, variables and menus. If you're interested, I could send you the rest. You might even want to try LysKOM yourself, it is quite addictive :-) --=20 David K=E5gedal Lysator Academic Computer Society davidk@lysato= r.liu.se http://www.lysator.liu.se/~davidk/ +46-13 17= 65 89