Package: gettext
Version: 0.17-9
Severity: wishlist

If I run this in gnome-terminal:

% msgunfmt /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo

then msgunfmt makes msgids purple and msgstrs blue, by adding
escape sequences like "\033[34m" to the output.  However, if I
pipe the output to less, like so:

% msgunfmt /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo |
  less -R

then I do not get any colors.  Apparently, msgunfmt detects that
stdout is not a terminal.  Such detection is all right but there
should be a way to enable colors regardless.  In ls and git, this
is done with a --color option, but msgunfmt does not support that:

% LANG=C msgunfmt --color /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo
msgunfmt: unrecognized option '--color'
Try `msgunfmt --help' for more information.

I can instead get the desired result by filtering the output
through msgcat:

% msgunfmt /usr/share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo |
  msgcat --color - |
  less -R

but it seems silly that msgunfmt cannot do this on its own, given
that it already supports colorizing the output to a terminal.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gettext depends on:
ii  dpkg                     1.15.5.6        Debian package management system
ii  gettext-base             0.17-9          GNU Internationalization utilities
ii  install-info             4.13a.dfsg.1-5  Manage installed documentation in 
ii  libc6                    2.10.2-6        Embedded GNU C Library: Shared lib
ii  libcroco3                0.6.2-1         a generic Cascading Style Sheet (C
ii  libglib2.0-0             2.22.4-1        The GLib library of C routines
ii  libgomp1                 4.4.2-9         GCC OpenMP (GOMP) support library
ii  libncurses5              5.7+20090803-2  shared libraries for terminal hand
ii  libxml2                  2.7.6.dfsg-2+b1 GNOME XML library

Versions of packages gettext recommends:
ii  cvs                         1:1.12.13-12 Concurrent Versions System
ii  wget                        1.12-1.1     retrieves files from the web

Versions of packages gettext suggests:
pn  gettext-doc                   <none>     (no description available)

-- no debconf information

Attachment: pgp7E2Z7XUHPV.pgp
Description: PGP signature

Reply via email to