GNOME Bugzilla – Bug 408786
Not enough ngettext translations
Last modified: 2007-02-21 03:05:00 UTC
#: ../plugins/nautilus/seahorse-tool.c:372 ../src/seahorse-key-manager.c:405 #, c-format msgid "Imported %d keys" msgstr "Импортировано %d ключей" #. should never be called for just one file #: ../plugins/nautilus/seahorse-tool-files.c:174 #, c-format msgid "You have selected %d files" msgstr "Выбрано %d файлов" #: ../src/seahorse-delete.c:79 #, c-format msgid "Are you sure you want to permanently delete %d keys?" msgstr "Уверены, что хотите удалить %d ключей?" #: ../src/seahorse-key-manager.c:573 ../src/seahorse-keyserver-results.c:233 #, c-format msgid "Copied %d key" msgstr "Скопирован %d ключ" #: ../src/seahorse-key-manager.c:574 ../src/seahorse-keyserver-results.c:234 #, c-format msgid "Copied %d keys" msgstr "Скопировано %d ключей" #: ../src/seahorse-key-manager.c:945 ../src/seahorse-keyserver-results.c:298 #, c-format msgid "Selected %d key" msgstr "Выбран %d ключ" #: ../src/seahorse-key-manager.c:946 ../src/seahorse-keyserver-results.c:299 #, c-format msgid "Selected %d keys" msgstr "Выделено %d ключей" This will break string freeze, but I think it's rather critical thing and we should probably break freeze now then later.
Are you saying the translation needs to be updated? I don't think doing that violates the string freeze. If it's code you want updated, could you please attach a patch?
Created attachment 82726 [details] [review] Proposed patch
With the exception of src/seahorse-delete.c, it looks like you're just moving the placement of ngettext around. Is there a good reason to prefer your placement of ngettext over the current one? At the moment, the only part of the patch I would accept is the portion for src/seahorse-delete.c.
Hey, we are not moving ngettext around. Without that patch gettext will not know that strings are part of ngettext and will translate them as usual strings. I pasted strings from po file here, they should be included differently. In trunk we have: #: ../src/seahorse-key-manager.c:574 ../src/seahorse-keyserver-results.c:234 #, c-format msgid "Copied %d keys" msgstr "" #: ../src/seahorse-key-manager.c:945 ../src/seahorse-keyserver-results.c:298 #, c-format msgid "Copied %d keys" msgstr "" #: ../shell/ev-view.c:4135 #, c-format msgid "Copied %d key" msgid_plural "Copied %d keys" msgstr[0] "" msgstr[1] "" msgstr[2] ""
OK. I didn't understand what you were getting at I'll email gnome-i18n for permission to make the break.
Thanks a lot Adam.
(In reply to comment #2) > Created an attachment (id=82726) [edit] > Proposed patch > I don't understand, what are you doing in seahorse-tool.c. Adding only the + t = g_strdup_printf (ngettext ("Imported %d key", "Imported %d keys", mode->imports), mode->imports); line would be enough, wouldn't? Compare to the changes of seahorse-key-manager.c; this is the same situation.
In reply to comment #7 It's just the same as it were before, sometimes it would be nice to avoid numbers in messages, that's why case mode->imports == 1 is separated.
(In reply to comment #4) > Hey, we are not moving ngettext around. Without that patch gettext will not > know that strings are part of ngettext and will translate them as usual > strings. If you change translation from gettext to ngettext and translated messages are merged with string template, modified string will be marked as fuzzy. If translation has 100% translated strings, it will have 100% - 1 translated string and one fuzzy string. If you don't have other code with same string in ngettext format, it is a string break. Some translators don't like when their translation status goes down from 100% in stable branch. Get gnome-i18n approval or make sure that translation quality doesn't go worse after your mods.
(In reply to comment #9) > Some translators don't like when their > translation status goes down from 100% in stable branch. Get gnome-i18n > approval or make sure that translation quality doesn't go worse after your > mods. > Good thing we're discussing a development branch. Approval from gnome-i18n has been requested.
(In reply to comment #8) I understand, but I don't think this implementation is correct. Your current logic looks like this: if ($value==1) then (use one_item) else if ($value=="plural_expression") then (use plural) else (use singular) This is ugly. I don't know which howto or guideline advises to not to use this - if there are any. But this is simply ugly, and Gnome doesn't uses this form anyway. This assumes there are three different forms of the sentence, one for the value==1 case and two other for the singular/plural case - for all the languages available. Furthermore, it assumes the value==1 and singular cases are different - this is not true even for English, and the original sentences were not these. So, I propose to use ngettext ("Imported key", "Imported %d keys", mode->imports)
(In reply to comment #11) > This is ugly. > I don't know which howto or guideline advises to not to use this - if there are > any. But this is simply ugly, and Gnome doesn't uses this form anyway. This > assumes there are three different forms of the sentence, one for the value==1 > case and two other for the singular/plural case - for all the languages > available. Furthermore, it assumes the value==1 and singular cases are > different - this is not true even for English, and the original sentences were > not these. > So, I propose to use > ngettext ("Imported key", "Imported %d keys", mode->imports) You assume that first form applies only to 1. "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" 1 raktas (first form) 2 raktai (second form) 10 raktu (third form) 21 raktas (first form) Nikolay wants to display string without number, when %d equals to one. First ngettext form can be applied to other values of %d. In your case if some translation follows English rules and translators do --- msgid "Imported key" msgid_plural "Imported %d keys" msgstr[0] "Imported key" msgstr[1] "Imported %d keys" --- they will get errors on gettext check --- test.po:24: number of format specifications in 'msgid' and 'msgstr[0]' does not match msgfmt: found 1 fatal error --- Translations pass msgfmt checks and translators will be forced to use --- msgid "Imported key" msgid_plural "Imported %d keys" msgstr[0] "Imported %d key" msgstr[1] "Imported %d keys" --- String without %d will be used only in US English
same with czech language, the plural form changes from 4 to 5. everybody please use proper ngettext code instead of ugly workarounds. :-)
Is this just waiting on gnome-i18n, or is the patch incomplete?
We just need approval, sadly i18 team seems to be absent
I received this: Hi Adam, On Saturday at 10:51, Adam Schreiber wrote: > It has recently come to our attention that we were improperly using > ngettext [1] and this was causing the number related translations to > appear as normal strings and not together as a set. > > We are requesting permission to break string freeze to fix this. It > shouldn't require any additional translation just moving the current > translated strings around a little. > > [1] http://bugzilla.gnome.org/show_bug.cgi?id=408786 Since there seems to be a lot of interest by translators for this, here's my (late) approval. I also CCed release-team, since they need to know about this as well. Cheers, Danilo
Committed. Thanks. 2007-02-20 Adam Schreiber <sadam@clemson.edu> * src/seahorse-delete.c: * src/seahorse-keyserver-results.c: * src/seahorse-key-manager.c: * plugins/nautilus/seahorse-tool.c: Fix ngettext usage. Patch from Nickolay V. Shmyrev. Fixes bug #408786
Thanks a lot Adam