fish-shell/share/functions/_.fish
Fabian Homborg 02ca7be416 functions/_.fish: Use ggetext if available
It turns out the default gettext on the sunny operating system with
the many names interprets at least `\n` itself, so we'd end up
swallowing it.

This allows us to move past the interactive tests and onto the expect
ones.

See #5472.
2019-02-13 13:05:50 +01:00

22 lines
614 B
Fish

#
# Alias for gettext or a fallback if gettext isn't installed.
#
# Use ggettext if available.
# This is the case on OpenIndiana, where the default gettext
# interprets `\n` itself, so
# printf (_ 'somemessage\n')
# won't print a newline.
if command -sq ggettext
function _ --description "Alias for the ggettext command"
command ggettext fish $argv
end
else if command -sq gettext
function _ --description "Alias for the gettext command"
command gettext fish $argv
end
else
function _ --description "Fallback alias for the gettext command"
echo -n $argv
end
end