grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lib/arg.c: dynamic newline in help


From: Carles Pina i Estany
Subject: lib/arg.c: dynamic newline in help
Date: Sun, 27 Dec 2009 01:17:42 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hello,

Until now the options for the commands has been splitted (using a \n) by
the developer.

For example, commands/hdparm.c:

static const struct grub_arg_option options[] = {
  {"apm",             'B', 0, "Set Advanced Power Management\n"
                              "(1=low, ..., 254=high, 255=off).",
                              0, ARG_TYPE_INT},

This is a problem for the translations: translators should be aware 
that they need to cut the string after some number of characters,
or will not appear correctly formatted.

Attached patch splits it dynamically.

Note: the attached patch goes forward and then backward because some strings,
like above one, must have a \n to split some lines. But other strings could be
just be too long and could not have the \n line.

The number of characters per line is fixed as a constant because lib/argc.c
doesn't know anything about consoles. If I remember correctly is used in two
places: form help command and fstest. I think that the attached solution is
good enough for the current status.

I implemented it using another approach and changed to the current one,
so feel free to tell me any problem or things that you would improve. My
limited tests has been fine.

I think that after comitting it I will be able to gettext all options
strings.

Thanks,

-- 
Carles Pina i Estany
        http://pinux.info

Attachment: dynamic_split02.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]