mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-27 14:51:14 -03:00
The overwhelming majority of localizable messages comes from
completions:
$ ls share/completions/ | wc -l
$ 1048
OTOH functions also contribute a small amount, mostly via their
descriptions (so usually just one per file).
$ ls share/functions/ | wc -l
$ 237
Most of these are private and almost never shown to the user, so it's
not worth bothering translators with them. So:
- Skip private (see the parent commit) and deprecated functions.
- Skip wrapper functions like grep (where the translation seems to
be provided by apropos), and even the English description is not
helpful.
- Assume that most real systems have "seq", "realpath" etc.,
so it's no use providing our own translations for our fallbacks.
- Mark fish's own functions as tier1, and some barely-used functiosn
and completions as tier3, so we can order them that way in
po/*.po. Most translators should only look at tier1 and tier2.
In future we could disable localization for tier3.
See the explanation at the bottom of
tests/checks/message-localization-tier-is-declared.fish
Part of #11833
33 lines
877 B
Fish
33 lines
877 B
Fish
# localization: tier1
|
|
function dirh --description "Print the current directory history (the prev and next lists)"
|
|
set -l options h/help
|
|
argparse -n dirh --max-args=0 $options -- $argv
|
|
or return
|
|
|
|
if set -q _flag_help
|
|
__fish_print_help dirh
|
|
return 0
|
|
end
|
|
|
|
set -l dirc (count $dirprev)
|
|
if test $dirc -gt 0
|
|
set -l dirprev_rev $dirprev[-1..1]
|
|
# This can't be (seq $dirc -1 1) because of BSD.
|
|
set -l dirnum (seq 1 $dirc)
|
|
for i in $dirnum[-1..1]
|
|
printf '%2d) %s\n' $i $dirprev_rev[$i]
|
|
end
|
|
end
|
|
|
|
echo (set_color $fish_color_history_current)' ' $PWD(set_color normal)
|
|
|
|
set -l dirc (count $dirnext)
|
|
if test $dirc -gt 0
|
|
set -l dirnext_rev $dirnext[-1..1]
|
|
for i in (seq $dirc)
|
|
printf '%2d) %s\n' $i $dirnext_rev[$i]
|
|
end
|
|
end
|
|
echo
|
|
end
|