Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 1996 19:31:47 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        jkh@time.cdrom.com (Jordan K. Hubbard)
Cc:        hosokawa@mt.cs.keio.ac.jp, hackers@FreeBSD.org
Subject:   Re: New L10N boot floppy for 2.1.5-RELEASE
Message-ID:  <199608091001.TAA03094@genesis.atrad.adelaide.edu.au>
In-Reply-To: <28544.839581871@time.cdrom.com> from "Jordan K. Hubbard" at Aug 9, 96 02:11:11 am

next in thread | previous in thread | raw e-mail | index | archive | help
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  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608091001.TAA03094>