On errno
David Schultz
das at FreeBSD.ORG
Mon Mar 30 23:32:10 PDT 2009
On Tue, Mar 31, 2009, Poul-Henning Kamp wrote:
> In message <49D1492C.5050101 at 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.
More information about the freebsd-arch
mailing list