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

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

Re: Using `\t' in msgstr


From: Bruno Haible
Subject: Re: Using `\t' in msgstr
Date: Thu, 3 Apr 2008 20:02:26 +0200
User-agent: KMail/1.5.4

Yavor Doganov wrote:
> For quite some time I have been inserting the `\t' character ...
> ...
> 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?

A tab character in a string will be output as a tab character on the
output device, regardless of the programming language. But the interpretation
of a tab character in the output device depends on the device. On most
terminal emulators that use fixed-width fonts, the default setting is one
tab every 8 columns. But
  - As you discovered, there is a command 'tabs' that can be used to change
    the tab stops individually,
  - The output device may be a buffer in Eclipse, in which there is a tab
    stop every 4 columns, by default, even on Unix.
  - The output device may be using proportional fonts.

> 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                     Отваряне на нов подпрозорец в 
> съществуващия п
> розорец

I quoted that part of your mail, and as you can see, the line with the tabs
is not indented properly.

So the fix is to generally use spaces.

You can configure most editors to insert spaces when you press the tab key.
For example, for Emacs, append this to your ~/.emacs file:

  ;; Tabs are anachronistic.
  (setq-default indent-tabs-mode nil)

> OTOH, it seems to me that lots of C programs assume that `\t'
> produces displacement by 8

This is an invalid assumption.

It is a pity if users have to pipe a program's output (or input!) through
"expand -t 8" to get it looking good in their environment.

Bruno





reply via email to

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