mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
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.
This commit is contained in:
parent
1ee57e9244
commit
02ca7be416
1 changed files with 10 additions and 1 deletions
|
@ -1,7 +1,16 @@
|
||||||
#
|
#
|
||||||
# Alias for gettext or a fallback if gettext isn't installed.
|
# Alias for gettext or a fallback if gettext isn't installed.
|
||||||
#
|
#
|
||||||
if command -sq gettext
|
# 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"
|
function _ --description "Alias for the gettext command"
|
||||||
command gettext fish $argv
|
command gettext fish $argv
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue