After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 106702 - Please use ngettext for handling plurals in nautilus
Please use ngettext for handling plurals in nautilus
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: High normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 111773 (view as bug list)
Depends on:
Blocks: 116236
 
 
Reported: 2003-02-21 10:03 UTC by Christian Rose
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. Please report any problems! Not sure whether it's complete/exactly what you wanted. (13.14 KB, patch)
2003-10-02 20:50 UTC, Christian Neumair
none Details | Review
Proposed patch, taking into account Danilo's proposal (13.52 KB, patch)
2003-10-06 15:11 UTC, Christian Neumair
none Details | Review
Updated and (hopefully) corrected patch to use ngettext in Nautilus (12.37 KB, patch)
2004-01-13 00:10 UTC, Danilo Segan
none Details | Review
Another updated patch: tested, compiles *and* works fine (12.39 KB, patch)
2004-01-13 00:39 UTC, Danilo Segan
none Details | Review

Description Christian Rose 2003-02-21 10:03:47 UTC
#: components/hardware/nautilus-hardware-view.c:483
#, c-format
msgid "Uptime is %d days, %d hours, %d minutes"

#: components/image_properties/nautilus-image-properties-view.c:144
#, c-format
msgid ""
"<b>Image Type:</b> %s (%s)\n"
"<b>Resolution:</b> %dx%d pixels\n"

#: src/file-manager/fm-directory-view.c:486
#, c-format
msgid "This will open %d separate windows. Are you sure you want to do this?"

#: src/file-manager/fm-directory-view.c:488
#, c-format
msgid "Open %d Windows?"

#: src/file-manager/fm-directory-view.c:843
#, c-format
msgid "Are you sure you want to permanently delete the %d selected items?"

#: src/file-manager/fm-directory-view.c:1515
msgid "1 folder selected"

#: src/file-manager/fm-directory-view.c:1518
#, c-format
msgid "%d folders selected"

#: src/file-manager/fm-directory-view.c:1525
msgid " (containing 0 items)"

#: src/file-manager/fm-directory-view.c:1527
msgid " (containing 1 item)"

#: src/file-manager/fm-directory-view.c:1529
#, c-format
msgid " (containing %d items)"

#: src/file-manager/fm-directory-view.c:1536
msgid " (containing a total of 0 items)"

#: src/file-manager/fm-directory-view.c:1538
msgid " (containing a total of 1 item)"

#: src/file-manager/fm-directory-view.c:1540
#, c-format
msgid " (containing a total of %d items)"

#: src/file-manager/fm-directory-view.c:1557
#, c-format
msgid "%d items selected (%s)"

#: src/file-manager/fm-directory-view.c:1564
#, c-format
msgid "1 other item selected (%s)"

#: src/file-manager/fm-directory-view.c:1567
#, c-format
msgid "%d other items selected (%s)"

#: src/file-manager/fm-directory-view.c:3022
#, c-format
msgid ""
"The %d selected items cannot be moved to the Trash. Do you want to delete "
"them immediately?"

#: src/file-manager/fm-directory-view.c:3026
#, c-format
msgid ""
"%d of the selected items cannot be moved to the Trash. Do you want to delete "
"those %d items immediately?"

#: src/file-manager/fm-directory-view.c:3070
#, c-format
msgid ""
"Are you sure you want to permanently delete the %d selected items from the "
"Trash?"

#: src/file-manager/fm-directory-view.c:4405
#, c-format
msgid ""
"The %d selected items will be moved if you select the Paste Files command"

#: src/file-manager/fm-directory-view.c:4409
#, c-format
msgid ""
"The %d selected items will be copied if you select the Paste Files command"

#: src/file-manager/fm-directory-view.c:4678
#, c-format
msgid "Open _in %d New Windows"

#: src/file-manager/fm-properties-window.c:1230
#, c-format
msgid "%d items, totalling %s"

#: src/file-manager/fm-search-list-view.c:568
#, c-format
msgid "Reveal in %d _New Windows"

#: src/nautilus-location-bar.c:154
#, c-format
msgid "Do you want to view these %d locations in separate windows?"


As mentioned in
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals,
this way of handling plurals is broken for many locales. A way to solve
this is by using ngettext instead as mentioned in that document.
A simple code example of code using ngettext:

  g_printf (ngettext ("Found %d file.", "Found %d files.", nbr_of_files),
nbr_of_files);
Comment 1 Danilo Segan 2003-04-28 18:39:22 UTC
I didn't check if it's still relevant for GNOME 2.3, but there are a
couple more strings that need fixing listed at
http://bugzilla.gnome.org/show_bug.cgi?id=111773
Comment 2 Christian Rose 2003-04-28 19:11:51 UTC
*** Bug 111773 has been marked as a duplicate of this bug. ***
Comment 3 Christian Rose 2003-04-28 19:14:05 UTC
dsegan@gmx.net noticed that this problem also affects these messages:

#: libnautilus-private/nautilus-file.c:3942
#, c-format
msgid "%u items"

#: libnautilus-private/nautilus-file.c:3942
#, c-format
msgid "%u folders"

# bug: plural-forms
#: libnautilus-private/nautilus-file.c:3943
#, c-format
msgid "%u files"
Comment 4 Christian Rose 2003-09-30 08:23:03 UTC
Can we have this issue revisited now?
Comment 5 Danilo Segan 2003-09-30 16:09:58 UTC
I'll add that this one:
msgid ""
"<b>Image Type:</b> %s (%s)\n"
"<b>Resolution:</b> %dx%d pixels\n"

shoud be "pluralized" on the *second* %d.


Also, if nobody does it before, I'll probably submit a patch here for
all of these in about a week.

Btw, how is any of this related to "spatial" Nautilus branch -- i.e.
will there be any problems merging the separate patches if "spatial"
turns out to be the choice for 2.6?
Comment 6 Christian Neumair 2003-10-02 20:50:44 UTC
Created attachment 20445 [details] [review]
Proposed patch. Please report any problems! Not sure whether it's complete/exactly what you wanted.
Comment 7 Danilo Segan 2003-10-06 02:08:43 UTC
This also affects recently added message:

#: src/file-manager/fm-directory-view.c:4791
#, c-format
msgid "%d Navigation Windows"
Comment 8 Christian Neumair 2003-10-06 15:11:13 UTC
Created attachment 20511 [details] [review]
Proposed patch, taking into account Danilo's proposal
Comment 9 Sebastien Bacher 2003-11-26 22:51:14 UTC
I'm raising the priority to high since a patch is attached.
Comment 10 Christian Rose 2004-01-10 18:01:22 UTC
Could we have this revisited RSN before freezes apply?
Comment 11 Danilo Segan 2004-01-13 00:10:41 UTC
Created attachment 23289 [details] [review]
Updated and (hopefully) corrected patch to use ngettext in Nautilus
Comment 12 Danilo Segan 2004-01-13 00:25:27 UTC
This is updated patch which applies cleanly to HEAD as of couple of
hours back. ChangeLog entry is included (it won't be applied, "patch"
should ignore it).

There were a few changes in Nautilus since last patch was made, and
they are reflected in the new patch.

Btw, I've just compiled it and noticed one mistake, I will follow up
with a corrected patch. 
Comment 13 Danilo Segan 2004-01-13 00:39:02 UTC
Created attachment 23291 [details] [review]
Another updated patch: tested, compiles *and* works fine
Comment 14 Danilo Segan 2004-01-13 01:03:22 UTC
Ok, this is fixed in CVS, so if Dave (after another review, he is the
one who [sort of] approved the commit) doesn't come shooting my way,
this can probably be marked as RESOLVED/FIXED.
Comment 15 Christian Neumair 2004-01-14 16:27:39 UTC
Closing. Thanks for your efforts.

regs,
 Chris