Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aN1jFOTqHkT-5J0B@voyager>
Date: Wed, 1 Oct 2025 19:21:24 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: Selecting locale source format

Am Wed, Oct 01, 2025 at 03:55:59PM +0200 schrieb Pablo Correa Gomez:
> We got now a few replies from translators, and the most remarkable
> thing that was brought up is how to deal with natural text whose
> translations might change depending on context. Both plural forms and
> declinations were brought up.
> 
> Discussing a bit with Rich, it seems that such thing will not be an
> issue for strings related to the libc API, which is what is the biggest
> concern of the work we are doing now. However, there are
> implementation-dependent strings in libc, like dynamic linker messages,
> which could potentially be added in the future. Still, since we are
> setting the file format, it would be important to make sure that
> whatever we come up now is flexible enough to not block future
> development. Any thoughts?

The msgfmt source format specified by POSIX allows multiple plurals and
an arbitrary C expression to select the correct one. So that is one way
to go. The alternative is to stay agnostic to numbers and just always
use all forms in parentheses, e.g. "Loaded %d file(s)".

While I appreciate that the necessity for an expression parser might
increase complexity by a lot, what little I do remember of Russian
suggest that not many simpler alternatives exist. In Russian, just for
example, there are three numbered forms, namely the nominative singular,
the nominative plural, and the genitive plural. The nominative singular
is used whenever the number in question ends in 1 but not 11, the
nominative plural is used for 2-4 but not 12-14, and the genitive plural
is used in all other cases.

That logic is specific to one language (although I suspect a lot might
be shared with other Slavic languages), so it must be specified in the
source format if the feature is desired at all.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.