When I use:
msgattrib --untranslated pl.po
to see untranslated strings from po file I've got strings in color, but not when I use:
msgattrib --untranslated pl.po | less
msgattrib display colors only if executed from real terminal. You can use
unbuffer command that's part of
expect to make
msgattrib think that it's executed from real terminal and then use
-r option to handle ANSI escapes in
unbuffer msgattrib --untranslated pl.po | less -r
You can do that in any command that produce colors (ANSI escapes codes) based on existance of tty.
From the less man page:
-R or --RAW-CONTROL-CHARS
Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases.
The simplest way to have this enabled all the time is to set the
LESS environment variable in your
.login script. I use both
-X (which prevents the screen being cleared when less exits).