GNOME Bugzilla – Bug 344896
one gettext form used for plural string with numbers
Last modified: 2006-06-25 17:34:02 UTC
Please describe the problem: app/display.c uses simple gettext call to translate text with numbers. msg = g_strdup_printf (_("Selection of %d objects"), n); Such gettext call works only in languages that have one form for all n>1 strings. Strings with numbers should use ngettext calls. Steps to reproduce: You can't translate "Selection of %d objects" string correctly in some languages. Actual results: Expected results: I suspect that correct call is msg = g_strdup_printf (ngettext(N_("Selection of %d object"),N_("Selection of %d objects"),n), n); Does this happen every time? Other information:
Iy you look some line above the line in quuestion you'll see 'if (n > 1)' so it is ensured that the plural from is always required. For a single object selection it's name is displayed.
Translation of "%d objects" to Lithuanian %d is from 2 to 9 2-9 objektai %d is from 10 to 20 10-20 objektu %d is 21 21 objektas %d is from 22 to 29 22-29 objektai there are 3 different word forms for "object" in Lithuanian and they depend on %d. Only some languages have one noun form for %d = 1 and other form for %d > 1. See http://www.gnu.org/software/gettext/manual/html_chapter/gettext_10.html#SEC150
Thanks for the explanation, now fix as you suggested. And feel free to reopen when I'm wrong ;-) 2006-06-15 Hans Breuer <hans@breuer.org> * app/display.c : use ngettext() for possible plural variations. (Bug #344896, tokul@users.sourceforge.net)
Noise because there is no direct way from "Not a bug"->"Fixed"
Sorry. used broken code sample from gnumeric. Standard gettext calls are not needed inside ngettext call. msg = g_strdup_printf (ngettext("Selection of %d object","Selection of %d objects",n), n); I am not sure if fix is correct and does not require more changes in dia code. I am not C programmer and don't have i18n coding experience in gnome.
Reopening the bug. I've used broken code from Gnumeric. http://bugzilla.gnome.org/show_bug.cgi?id=345027 Don't use gettext calls inside ngettext call.
2006-06-25 Hans Breuer <hans@breuer.org> * app/display.c : avoid to call gettext on parameters for ngettext() Should finally really fix bug #344896