From owner-freebsd-arch@FreeBSD.ORG Tue Mar 31 06:32:09 2009 Return-Path: Delivered-To: arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7ABC106567A for ; Tue, 31 Mar 2009 06:32:09 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 951C28FC19 for ; Tue, 31 Mar 2009 06:32:09 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n2V6Vxt8009349; Tue, 31 Mar 2009 02:31:59 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n2V6VxDx009348; Tue, 31 Mar 2009 02:31:59 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 31 Mar 2009 02:31:59 -0400 From: David Schultz To: Poul-Henning Kamp Message-ID: <20090331063159.GA9265@zim.MIT.EDU> Mail-Followup-To: Poul-Henning Kamp , Tim Kientzle , Daniel Eischen , FreeBSD Arch , Marcel Moolenaar References: <49D1492C.5050101@freebsd.org> <95823.1238476941@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95823.1238476941@critter.freebsd.dk> Cc: Daniel Eischen , FreeBSD Arch , Tim Kientzle , Marcel Moolenaar Subject: Re: On errno X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 06:32:10 -0000 On Tue, Mar 31, 2009, Poul-Henning Kamp wrote: > In message <49D1492C.5050101@freebsd.org>, Tim Kientzle writes: > > >> The probelm with an integer is that you cannot give details > >> like: > >> "partition 3 overlaps bootcode" > >> without precreating the N^2 possible messages of that kind. > > > >The standard solution if you need variable parameters, > >of course, is to pass the parameters back: > > int code: EPARTITIONOVERLAPSBOOTCODE > > char *default_text: "partition %1d overlaps bootcode" > > arg1: 3 > > And the "standard" solution is stupid and useless, because more > often than not, some language, typically french, will want the > arguments in the opposite order... You could get the extensibility you're looking for without annoying the i18n folks by making the strings conform to a simple machine-parsable grammar. For instance, the above might be: "geom:part:overlaps bootcode(3)" A user-level library function could parse this, look up a natural language translation in a locale-specific database, and fall back on a generic format if no translation is available.