From owner-freebsd-hackers Fri Aug 9 02:47:57 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA27650 for hackers-outgoing; Fri, 9 Aug 1996 02:47:57 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id CAA27603 for ; Fri, 9 Aug 1996 02:47:49 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id TAA03094; Fri, 9 Aug 1996 19:31:47 +0930 From: Michael Smith Message-Id: <199608091001.TAA03094@genesis.atrad.adelaide.edu.au> Subject: Re: New L10N boot floppy for 2.1.5-RELEASE To: jkh@time.cdrom.com (Jordan K. Hubbard) Date: Fri, 9 Aug 1996 19:31:47 +0930 (CST) Cc: hosokawa@mt.cs.keio.ac.jp, hackers@FreeBSD.org In-Reply-To: <28544.839581871@time.cdrom.com> from "Jordan K. Hubbard" at Aug 9, 96 02:11:11 am MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Jordan K. Hubbard stands accused of saying: > 3. The message catalog stuff you did for sysinstall looks reasonable, > though with the usual effect of making the user interaction > completely incomprehensible if you're trying to read through or > trace the code by eye. :-) Since you have an english message A couple of possible ways to ease the pain of message catalogs : Use _really_obnoxious_ constants for your catalog indices : MC_YES MC_RETRY MC_FTP_ERROR_OCURRED_WHILE_CONNECTING Use a translation-oriented catalog lookup; ie. something like : mp1 = translate("FTP Error"); mp2 = translate(strerror(errno)); mp3 = translate("an error occurred retrieving %s",filename); error_dialog(mp1,mp2,mp3); multifree(mp1,mp2,mp3); where the translate() function looks up its argument string in the catalog, replaces it with the corresponding translation to the local language if it finds it, and then sprintf's the remaining arguments in. (note that reordering the arguments is left as an exercise to the masochistic; SunOS provides an argument index option for *printf which makes the reordering task much simpler). For the latter approach to work nicely, you need a tool to check your source and bitch about messages that aren't in the catalog seperate from the compilation process though. > Jordan -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[