bug-gnu-utils
[Top][All Lists]
Advanced

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

Using `\t' in msgstr


From: Yavor Doganov
Subject: Using `\t' in msgstr
Date: Thu, 03 Apr 2008 17:56:57 +0300
User-agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/22.1 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI)

For quite some time I have been inserting the `\t' character to format
nicely the output where necessary, especially in `--usage' or `--help'
options.

For example:

#: ../src/ephy-main.c:76
msgid "Open a new tab in an existing browser window"
msgstr ""
"Отваряне на нов подпрозорец в съществуващия\n"
"\t\t\t\t    прозорец"

Which leads to

  -n, --new-tab                     Отваряне на нов подпрозорец в съществуващия
                                    прозорец

instead of

  -n, --new-tab                     Отваряне на нов подпрозорец в съществуващия 
п
розорец

When most of the translated descriptions of the options are long, the
output looks bad and hard to read if not aligned properly.

However, our translation team leader noticed that some terminals may
reset the horizontal tab to a non-standard value, via the `tabs'
utility as specified by POSIX [1] or some other way.

This seems to be the case on FreeBSD [2], so he suggests to replace
all usages of \t with 8 consecutive spaces.


OTOH, it seems to me that lots of C programs assume that `\t'
produces displacement by 8, for example GNU nano:

void print_opt_full(const char *shortflag
#ifdef HAVE_GETOPT_LONG
        , const char *longflag
#endif
        , const char *desc)
{
    printf(" %s\t", shortflag);
    if (strlenpt(shortflag) < 8)
        printf("\t");

#ifdef HAVE_GETOPT_LONG
    printf("%s\t", longflag);
    if (strlenpt(longflag) < 8)
        printf("\t\t");
    else if (strlenpt(longflag) < 16)
        printf("\t");
#endif

    if (desc != NULL)
        printf("%s", _(desc));
    printf("\n");
}

IMVHO, the output of `nano --help' even in a C locale would look
rather messy if a user resets \t somehow.

My question is: Is my usage of \t in msgstr's sane or a bad thing?  If
the former, is it safe for all programming languages?  
If it leads to undesirable effects (on FreeBSD, for example), what is
the proper way to deal with such issues?  Using spaces or something
different?

Thanks in advance for any answer/advice.

[1] http://www.opengroup.org/onlinepubs/009695399/utilities/tabs.html
[2] http://lists.freebsd.org/pipermail/freebsd-current/2008-April/084668.html




reply via email to

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