FS#70556 - Use plural-form string with ngettext in pacman-key
Attached to Project:
Pacman
Opened by Rafael Fontenelle (josephg) - Friday, 23 April 2021, 09:43 GMT
Opened by Rafael Fontenelle (josephg) - Friday, 23 April 2021, 09:43 GMT
|
Details
Summary and Info:
Two strings from 'pacman-key' contain a variable for key count, and as such should be used as plural-form string[1]. Not using a plural-form string, might be OK in English and most languages, but might be harder for other languages with a more complex plural rules[2]. The strings are: - "Disabled %s keys." (line 376) - "Locally signed %s keys." (line 507) My suggestion is to use "ngettext" and set a singular and a plural versions of this string, even if the singular form is never going to be used. This way 1) translators are sure that %s means a count, and 2) the translation respects the target locale's plural-form. See attached git-diff from master branch. [1] https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html [2] http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html |
This task depends upon
Comment by Allan McRae (Allan) -
Sunday, 04 December 2022, 10:22 GMT
Comment by Allan McRae (Allan) -
Friday, 23 December 2022, 07:35 GMT
This requires slightly more work. We test if gettext is present
and fallback to a plain printf if not. Something similar needs
done for ngettext.
https://gitlab.archlinux.org/pacman/pacman/-/merge_requests