pacman-key: Use ngettext for plurals
There are two strings that may be singular or plural in pacman-key. Use ngettext to handle these strings correctly, and provide a fallback function if it is not available. Fixes FS#70556. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
6344aab3bd
commit
3f8029af92
1 changed files with 12 additions and 2 deletions
|
@ -378,7 +378,7 @@ populate_keyring() {
|
||||||
key_count=$((key_count+1))
|
key_count=$((key_count+1))
|
||||||
done
|
done
|
||||||
if (( key_count )); then
|
if (( key_count )); then
|
||||||
msg2 "$(gettext "Disabled %s keys.")" "${key_count}"
|
msg2 "$(ngettext "Disabled %s key." "Disabled %s keys." "${key_count}")" "${key_count}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -506,7 +506,7 @@ lsign_keys() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if (( key_count )); then
|
if (( key_count )); then
|
||||||
msg2 "$(gettext "Locally signed %s keys.")" "${key_count}"
|
msg2 "$(ngettext "Locally signed %s key." "Locally signed %s keys." "${key_count}")" "${key_count}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,6 +612,16 @@ if ! type gettext &>/dev/null; then
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! type ngettext &>/dev/null; then
|
||||||
|
ngettext() {
|
||||||
|
if (( $3 == 1 )); then
|
||||||
|
echo "$1"
|
||||||
|
else
|
||||||
|
echo "$2"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
OPT_SHORT="adefhlruvV"
|
OPT_SHORT="adefhlruvV"
|
||||||
OPT_LONG=('add' 'config:' 'delete' 'edit-key' 'export' 'finger' 'gpgdir:'
|
OPT_LONG=('add' 'config:' 'delete' 'edit-key' 'export' 'finger' 'gpgdir:'
|
||||||
'help' 'import' 'import-trustdb' 'init' 'keyserver:' 'list-keys' 'list-sigs'
|
'help' 'import' 'import-trustdb' 'init' 'keyserver:' 'list-keys' 'list-sigs'
|
||||||
|
|
Loading…
Add table
Reference in a new issue