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 759491 - Plural form for string "%s / %s available"
Plural form for string "%s / %s available"
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-12-15 13:26 UTC by Dušan
Modified: 2015-12-15 20:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkplacesviewrow: plural form for available space (1.88 KB, patch)
2015-12-15 15:01 UTC, Carlos Soriano
none Details | Review
gtkplacesviewrow: plural form for available space (1.90 KB, patch)
2015-12-15 16:04 UTC, Carlos Soriano
committed Details | Review

Description Dušan 2015-12-15 13:26:31 UTC
Can be created plural form for this string?

#: ../src/gtk/gtkplacesviewrow.c:110
#, c-format
msgid "%s / %s available"


Many languages have different form for translation of word "available", that is dependent on amount in first variable "%s"


DEV wiki: https://wiki.gnome.org/TranslationProject/DevGuidelines/Plurals
Comment 1 Carlos Soriano 2015-12-15 13:50:28 UTC
-> gtk+
Comment 2 Carlos Soriano 2015-12-15 15:01:20 UTC
Created attachment 317429 [details] [review]
gtkplacesviewrow: plural form for available space

We were not supporting plural form of the available space, which
is a problem in some languages.
However in this case is kind of a difficult matter, since we use a
formatted string from glib with g_format_size.

To fix it, use the same behavior as g_format_size to decide when
it should be used a plural form or not.
Comment 3 Matthias Clasen 2015-12-15 15:38:53 UTC
Review of attachment 317429 [details] [review]:

::: gtk/gtkplacesviewrow.c
@@ +126,3 @@
+  plural_form = free_space < 1000 ? free_space : free_space % 1000 + 1000;
+  /* Translators: respectively, free and total space of the drive. The plural form
+   * should be based on the free space available, which is the first string. */

I think it would be instructive to give an example of what the formatted string might look like for translators.

Pet peeve of mine: move the closing  */ to the next line and make the stars line up
Comment 4 Carlos Soriano 2015-12-15 16:04:29 UTC
Created attachment 317432 [details] [review]
gtkplacesviewrow: plural form for available space

We were not supporting plural form of the available space, which
is a problem in some languages.
However in this case is kind of a difficult matter, since we use a
formatted string from glib with g_format_size.

To fix it, use the same behavior as g_format_size to decide when
it should be used a plural form or not.
Comment 5 Matthias Clasen 2015-12-15 16:37:07 UTC
Review of attachment 317432 [details] [review]:

fine to push with those fixes

::: gtk/gtkplacesviewrow.c
@@ +125,3 @@
+  /* read g_format_size code in glib for further understanding */
+  plural_form = free_space < 1000 ? free_space : free_space % 1000 + 1000;
+  /* Translators: respectively, free and total space of the drive. The plural form

I would put a newline before the comment here, just to keep the plural_from assignment from being lost between the two comments.

@@ +129,3 @@
+   * i.e. 1 GB / 24 GB available.
+   */
+  label = g_strdup_printf (ngettext("%s / %s available", "%s / %s available", plural_form),

Put a space before (
Comment 6 Matthias Clasen 2015-12-15 20:00:13 UTC
Attachment 317432 [details] pushed as 8858c3a - gtkplacesviewrow: plural form for available space