On Tue, Jul 31, 2018 at 01:34:22PM +0200, Pavel Machek wrote:
> On Tue 2018-07-31 11:11:53, David Howells wrote:
> > Pavel Machek <pa...@ucw.cz> wrote:
> > > Proposal is "message %s foo %s\0param 1\0param2\0", only strings
> > > allowed.
> > 
> > I think that's too strict and you will need to allow integer values, IP
> > addresses and possibly other things also.  It could certainly have a limited
> > set (e.g. no kernel pointers).
> 
> I'd always use strings at kernel->user interface. Yes, we should
> support integers and IP addresses in kernel, but I'd convert them to
> strings before passing them to userspace.

Then you haven't solved the translation problem at all; you've just made
the in-kernel implementation harder.  One example from the gettext docs:

  In Polish we use e.g. plik (file) this way:

    1 plik
    2,3,4 pliki
    5-21 plików
    22-24 pliki
    25-31 plików

Your proposal means that userspace needs to detect "%s file", determine
if the corresponding string consists of ^[0-9]*$, then parse the string
to figure out which of the plik* words is the correct one to use.

In my preferred solution of just sending the damned english string,
it's no more complex to regex match the string for "[0-9]* file", and
choose the appropriate plik* translation.

Reply via email to