l10n: plurals not generated correctly for ngettext
When doing Czech translation, I noticed this in generated .pot:
#: src/usb-device-widget.c:393
#, c-format
msgid "Select USB devices to redirect (%d free channel)"
msgstr ""
#: src/usb-device-widget.c:394
#, c-format
msgid "Select USB devices to redirect (%d free channels)"
msgstr ""
Which is derived from:
free_channels_str = ngettext(_("Select USB devices to redirect (%d free channel)"),
_("Select USB devices to redirect (%d free channels)"),
free_channels);
This seems wrong, according to gettext docs, such cases should look in .pot files like this:
#: src/usb-device-widget.c:393
#, c-format
msgid "Select USB devices to redirect (%d free channel)"
msgid_plural "Select USB devices to redirect (%d free channels)"
msgstr[0] ""
msgstr[1] ""
I created the .pot manually by adding arguments from Makevars to xgettext command:
xgettext --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --flag=g_dngettext:2:pass-c-format --flag=g_strdup_printf:1:c-format --flag=g_string_printf:2:c-format --flag=g_string_append_printf:2:c-format --flag=g_error_new:3:c-format --flag=g_set_error:4:c-format --flag=g_markup_printf_escaped:1:c-format --flag=g_log:3:c-format --flag=g_print:1:c-format --flag=g_printerr:1:c-format --flag=g_printf:1:c-format --flag=g_fprintf:2:c-format --flag=g_sprintf:2:c-format --flag=g_snprintf:3:c-format --files-from POTFILES.in --directory .. --output spice-gtk.pot
Edited by David Jaša