[Top][All Lists]

[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'

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
        , const char *longflag
        , const char *desc)
    printf(" %s\t", shortflag);
    if (strlenpt(shortflag) < 8)

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

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

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

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]